Jump to content

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


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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.