Jump to content

Header Question --Yes I read the other topic and my question is different


kalyke

Recommended Posts

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.

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.