note 7813 added to Predefined variables
| From: | maxim at j-door dot com | Date: | Wed, 16 Aug 2000 08:05:19 +0000 |
| Subject: | note 7813 added to Predefined variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1943@lists.php.net to get a copy of this message | ||
Very often it is better to check for $HTTP_REFERER before you start using it, because as your script
will be becoming bigger and many thing are depending from the refering URL - you are in trouble:
strange things WILL happen!
you'd better then use something like this:
<PRE>
<?
if ($HTTP_REFERER)
$myRef =$HTTP_REFERER;
//or you could use something like this instead:
if (!IsSet($HTTP_REFERER))
$myRef =$HTTP_REFERER;
?>
</PRE>
..and it is valid also for smaller scripts -- it's is safer, and plus you can add an ELSE
condition to it...
Maxim Maletsky
http://www.php.net/manual/language.variables.predefined.php