Server variable (Referer) doesn't work
Moderator: General Moderators
Server variable (Referer) doesn't work
$HTTP_SERVER_VARS['HTTP_REFERER']
This variable just stopped working for me. It was working before, now it gives me nothing when I try to echo it. I don't think I've changed any settings between the time it worked and now, but I'm not 100% sure of that. Is there anything that would cause this to not work?
Or does anyone know of another way to detect the URL of the last page you came from?
This variable just stopped working for me. It was working before, now it gives me nothing when I try to echo it. I don't think I've changed any settings between the time it worked and now, but I'm not 100% sure of that. Is there anything that would cause this to not work?
Or does anyone know of another way to detect the URL of the last page you came from?
go to http://www.php.net and checkthe version you're using. it was probably deprecated.
the $HTTP_XXXX_VARS arrays have all been deprecated. for $_XXXX
the $HTTP_XXXX_VARS arrays have all been deprecated. for $_XXXX
have you tried searching what's there by default via http://www.php.net? how about checking that your test is working rright.. ie: that your bastion host allows refferes to be sent
Well did you change browsers? The "User-Agent" aka browser is responsible for setting the HTTP_REFERER value. Normally its set when you click a link, so if you/a user reaches the page via a bookmark or via directly typing a url then no HTTP_REFERER will be set. Furthermore some proxies strip HTTP_REFERER information.
Are you testing from a different location than before so maybe there is a different proxy?
ps. the hard part about HTTP_RERERER is knowing when to stop ERERERERERER...
Are you testing from a different location than before so maybe there is a different proxy?
ps. the hard part about HTTP_RERERER is knowing when to stop ERERERERERER...
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Definitely comes from the browser - that's why it's so unreliable.jmarcv wrote:nielsene:
>The "User-Agent" aka browser is responsible for setting the HTTP_REFERER value.
Really??? I thought that came from Apache, since it is an apache enviornment variable!
God help us when we have to depend on browsers for data!
Mac
The HTTP_REFERER variable is considered a "Server Variable" (http://us4.php.net/manual/en/reserved.v ... les.server). It's not exclusive to Apache.Yow! So, what other 'Apache Enviornment' variables in PHP are there that don't come from Apache?
"Server Variables" are just things that PHP expects to have handed to it by the server. In this case Apache/IIS/etc attempts to extract the referrer field from the request and sets it up for php use when handing it over.
So yes, your webserver handles the parsing of the data, but its only as accurate as the value submitted by the user's browser.
This is true of almost all the server variables, the notable exceptions are those that start with "SERVER_*".
So yes, your webserver handles the parsing of the data, but its only as accurate as the value submitted by the user's browser.
This is true of almost all the server variables, the notable exceptions are those that start with "SERVER_*".