alright so i have this login script that logs in the user perfectly fine, but then it redirects back to the index page on dafault. how do i make it so the header location redirects back to the page it came from?
thanks
Comments
danielneriWP V.I.P.VPS - Virtual Prince of the Server
You would have to have some sort of hidden tag in the form which contains the name of the page the user is currently on. And then when they login the script directs them back to that page...
The Royal Ram
danielneriWP V.I.P.VPS - Virtual Prince of the Server
Have that bit of code within the form tags of the login form...
Then in the actual login.php script or whatever is doing the login processing just then make it redirect to the value of that hidden input...
For example in PHP you could access that value using $_POST[goto]
Maybe echo that out in a link, put .html after it and it would link the user back.. Or you could make it automatically redirect...
The Royal Ram
danielneriWP V.I.P.VPS - Virtual Prince of the Server
but using that script ^^ i would have to manually code each page by myself...isnt there som way i could do something like
[php]header("Location: [referring page???]");[/php]
Comments
The Royal Ram
Have that bit of code within the form tags of the login form...
Then in the actual login.php script or whatever is doing the login processing just then make it redirect to the value of that hidden input...
For example in PHP you could access that value using $_POST[goto]
Maybe echo that out in a link, put .html after it and it would link the user back.. Or you could make it automatically redirect...
The Royal Ram
[php]header("Location: [referring page???]");[/php]
anything?
I think thats right anyway... basically that preset variable contains the current filename/location of the user...
The Royal Ram
im trying to say is there any way i can make the script redirect to the page it CAME from automatically??
[PHP]
header("location: " . $_SERVER);
[/PHP]