xcali Posted April 24, 2008 Share Posted April 24, 2008 hi again guys once again I'm stuck and i seek some help if possible My problem is this: after the user logs in, cookie is created regis_as and it can have one of 4 values inside: either C, M, I or P now if the user wants to view a certain page, he is redirected to usercheck.php (code below) and there should be a check if the value from the cookie is equal to a certain value so i have this cheap little script <? // check if the info inside cookies is = to a certain value if ($_COOKIE['regis_as'] = 'C')) { //go to some section Header ("Location: browse.php"); } else { // redirect to some other section Header ("Location: uc.php"); } ?> but for some reason it does not redirect the users - i just get a blank page is my whole "($_COOKIE['regis_as'] = 'C'))" suppose to look different or is this just a little mistake i did somewhere? please advise thank you Link to comment https://forums.phpfreaks.com/topic/102767-if-xx-then-redirect-question/ Share on other sites More sharing options...
Zhadus Posted April 24, 2008 Share Posted April 24, 2008 ($_COOKIE['regis_as'] == 'C')) Link to comment https://forums.phpfreaks.com/topic/102767-if-xx-then-redirect-question/#findComment-526388 Share on other sites More sharing options...
xcali Posted April 24, 2008 Author Share Posted April 24, 2008 thank you for the reply i did try it as well as putting single quotes ' instead of " but still same thing :/ heres a screenshot of the cookie and its value as mentioned before id like to have the content of that cookie ( 'I' ) compared to a certain value (in my script 'C') any other ideas what could be wrong? :/ Link to comment https://forums.phpfreaks.com/topic/102767-if-xx-then-redirect-question/#findComment-526410 Share on other sites More sharing options...
Zhadus Posted April 24, 2008 Share Posted April 24, 2008 Well it MUST be double equals sign. So make that a permanent change Try commenting out the redirects and echo the variable to see what it's actually carrying. Link to comment https://forums.phpfreaks.com/topic/102767-if-xx-then-redirect-question/#findComment-526416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.