Msg#: 3634727 posted 6:51 am on Apr 25, 2008 (gmt 0)
If there is no referrer in existence then this variable will not be defined and therefore if you try to do something with it, since it doesn't exist, you will get an error. You should always check to see if it is there first before you do anything with it: if(isset($_SERVER['HTTP_REFERER'])) #do something
If there is no referrer in existence then this variable will not be defined...
...The user may have typed the URL directly or the user agent might simply not be setting the referrer. But whether PHP actually reports an error (or 'notice' in this case) when you refer to $_SERVER["HTTP_REFERER"] (when it does not exist) may be due to the setting of error_reporting() or display_errors - the default settings of which may be different on different servers. It may work OK in this instance because PHP is defaulting the value to an empty string, but this may not be the intention of the programmer, hence the 'notice'/warning.