note 7813 modified in Predefined variables by ronabop
| From: | ronabop@php.net | Date: | Fri, 18 Aug 2000 03:45:05 +0000 |
| Subject: | note 7813 modified in Predefined variables by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-2295@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/predefined-variables.php