kalyke Posted February 7, 2008 Share Posted February 7, 2008 I have a php file that does nothing except set sessions and cookies and then redirects to the page the user linked from there are no echos or anything like that, I just wanted that to be clear. The problem is that the code: ... if(isset($_COOKIE['refurl'])){ $CookieJar = $_COOKIE['refurl']; header("Location: ".$CookieJar); } It tries to redirect like it is supposed but repeates the address stored in $CookieJar like 20 times and firefox says that the page is not redirecting like it is supposed to. the address bar just shows the url over and over again. I tested the $CookieJar variable, in an echo statement it only prints once and says what it should. Any Help would be wonderful. Quote Link to comment https://forums.phpfreaks.com/topic/89920-header-question-yes-i-read-the-other-topic-and-my-question-is-different/ Share on other sites More sharing options...
toplay Posted February 7, 2008 Share Posted February 7, 2008 It sounds like you're redirecting endlessly perhaps. Page A redirects to page B, then page B redirects to page A, and so on (endless loop). Or same page keeps redirecting to itself. Please note that the header() with location does not redirect right there and then...only when the script ends or an exit is reached. So, I'm not sure if you're showing us the whole entire code or not. What do you mean firefox says the page is not redirecting like it's supposed to? Please provide exact error messages, or link to site. Try in other browsers too. Quote Link to comment https://forums.phpfreaks.com/topic/89920-header-question-yes-i-read-the-other-topic-and-my-question-is-different/#findComment-460969 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.