A web page with this code snip at the top renders properly when viewing on Windows. However, I get a blank screen when viewing with FF or Safari on a Mac.
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
No, it’s the fact that HTTP_REFERER is unreliable and shouldn’t really be used.
Some browsers don’t send it, and many firewalls strip outgoing requests to make sure it isn’t sent.
What you could try is to check to see if the value is set at all:
if(!empty($_SERVER['HTTP_REFERER'])) {
$array = parse_url($_SERVER['HTTP_REFERER']);
// do your referrer checking stuff
} else {
// do other stuff when the referrer is not set
}
Note: as a security feature, checking the HTTP_REFERER to see if people came from another site or from your own site is totally useless.