Re: referrer: how to find out?
| From: | Lars Torben Wilson | Date: | Fri, 18 Aug 2000 08:35:32 +0000 |
| Subject: | Re: referrer: how to find out? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12432@lists.php.net to get a copy of this message | ||
Lucas K. Mathis writes:
> Is there any way to find out where people came from when they arrived
> at my page? Specifically, I'd like to know where they clicked on when
> they arrived at a dead page so I can either fix it (if it's on my
> site) or tell the webmaster of the site with the dead link to fix it.
> I've got an error page that comes up when somebody tries to access a
> page that's not there. On this page, I'd like to have a short PHP
> script that finds out where the person came from.
>
> anyway, I haven't found out if/how I can do that. Any help?
>
> lucas
>
> --
> Lucas K. Mathis
> http://www.lkmc.ch/
> --
> "Well fuck all them people, don't need no excuse for being who I am."
> -- (Frank Zappa, Joe's Garage)
You need $HTTP_REFERER. But you should be aware that it'll only be set
if the client has decided to set it; and even then, you can't
necessarily believe it. :) But mostly it works OK.
For a list of other variables such as this, check out the list of
automatically provided variables:
http://www.php.net/manual/language.variables.predefined.php
Cheers,
Torben
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+