Jump to content

redirect using session


sfx81

Recommended Posts

Hi, I got a page name in referrer variable, and by echoing it, it shows correct page, but I cant redirect it to to that page. I tried like this ...

 

echo $_SESSION['referrer'];

header('refresh:2; url = $_SESSION['referrer'] ');

result:

Parse error: syntax error, unexpected T_STRING in C:\wamp\www\test\signup.php on line 28

 

 

and then something like this.

echo $_SESSION['referrer'];

header('refresh:2; url = $_SESSION[\'referrer\'] ');

 

result: (Rather than taking value from variable, its redirecting to "$_SESSION['referrer'] page.)

http://localhost/test/$_SESSION['referrer']

 

Any idea whats going wrong ?

 

Link to comment
https://forums.phpfreaks.com/topic/112489-redirect-using-session/
Share on other sites

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.