The variable name is just $HTTP_REFERER. Some others are:


There's more which you can find by looping through the globals array:

foreach ($GLOBALS as $key=>$value)
print "\$GLOBALS[\"$key\"] == $value<br>\n";

Hope this helps!


"Jiaqing Wang" <[EMAIL PROTECTED]> wrote in message
> Hello, All,
> I'm currently working on a problem which is in need of HTTP referer or the
> similar technique, but I couldn't seem to find any article or links which
> illustrate the idea, I tried $_SERVER['HTTP_REFERER'] but somehow it
> work for me. Let me breifly explain what I did here:
> I have login page called login.php, in this page I do
> 1. verify user the username and password against my backend database.
> 2. once passwd is verified, opens up a session with this login session.
> 3. header("Location: ${_SERVER['HTTP_REFERER']}") this will send user who
> just logged in back to the whichever page they came from.
> I also have a bunch of service scripts providing the content of my site
> mysite.php which invokes the login.php page if it determines that the user
> is not logged in, after user goes through the logging in process, the
> login.php will re-direct it back to this particular page, of course the
> location of the page is dynamicly determined by HTTP_REFERER.
> The problem I'm having right now is that after the user is logged in, the
> login.php can never send it back to the page the user came from, it will
> just redraw the login.php page. Obviously, $_SERVER['HTTP_REFERER']
> the location of itself instead of the location of the page sent the user
> here.
> I hope this is clear to you, if any of you out here knew a clue please
> me out. Any comment is greatly appreciated.
> 9/11/2002

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to