LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP header("Location") (https://www.linuxquestions.org/questions/programming-9/php-header-location-180432/)

Gerardoj 05-11-2004 04:25 PM

PHP header("Location")
 
Hi I would like to know how can I redirect to the last page that I was looking?

I can do
PHP Code:

header("location:index.php"

But whit the above code always redirect me to index.php

I would like to redirect to the last page that I saw..

Thanks a lot..

david_ross 05-11-2004 04:29 PM

You could try using "$_SERVER['HTTP_REFERER'];" but not all browsers will send this so you may want to include the name of a page itself in the querystring - ie, in links.php:
<A href="script.php?referer=links.php">Run Script</A>

Then you can use the $_GET["referer"] variable to get the last page name.


All times are GMT -5. The time now is 12:09 PM.