RE: [PHP] Re: URL of calling page
| From: | Luke Woollard | Date: | Mon, 17 Feb 2003 05:17:49 +0000 |
| Subject: | RE: [PHP] Re: URL of calling page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135798@lists.php.net to get a copy of this message | ||
dude - try this:
echo $HTTP_REFERER;
It'l give you the refering page from when you came.
Luke Woollard
-----Original Message-----
From: Brendon [mailto:brendon@brendon.com]
Sent: Monday, 17 February 2003 3:17 PM
To: Acleave
Subject: [PHP] Re: URL of calling page
On Sun, 16 Feb 2003 15:58:30 -0600, Acleave <acleave@uark.edu> wrote:
> I believe there's a way in PHP to get the URL of the page that called the
> current page but can't find it. Is there such a function? Or would I
> have to use another script (like Javascript)?
>
> What I mean is if I click on a link on index.html to jeremiah.php I can
> call the function and find out I just came from index.html (and not
> henry.php or fred.php).
If you're trying to get back to a page, I would suggest passing the current
page as a variable to the next page.
e.g.
<a href="somepage.php?return_to=<? echo urlencode($_SERVER['REQUEST_URI'])
?>">Subscribe</a>
--
_BB
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php