RE: [PHP-WIN] HTTP_REFERER
| From: | Shrock, Court | Date: | Wed, 03 Jul 2002 17:36:07 +0000 |
| Subject: | RE: [PHP-WIN] HTTP_REFERER | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-14556@lists.php.net to get a copy of this message | ||
Two things:
The undefined notice you are getting is the result of your error_reporting
setting in your php.ini...
http://www.php.net/manual/en/function.error-reporting.php
What is ultimately causing the error is that not all HTTP requests to your
page have a referrer defined, therefore, on the occasions that the client
did not specify the referrer, you are getting the undefined notice because
it did not exist. You can test this my having a page that echoes out the
HTTP_REFERRER variable and also contains a link to itself....I think you
will catch on when you see it in action.
<?php
echo 'Referrer: '.$_SERVER['HTTP_REFERRER'];
echo '<br><a href="'. $PHP_SELF .'">Link</a>';
?>
> -----Original Message-----
> From: R.S. Herhuth [mailto:ronherhuth@pop.mindspring.com]
> Sent: Wednesday, July 03, 2002 5:32 AM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] HTTP_REFERER
>
>
>
> I have looked at several stats gathering code blocks and they
> use $HTTP_REFERER. When I use that I get and undefined
> variable error. I also tried
> $HTTP_SERVER_VARS["HTTP_REFERER"] which gets me an undefined
> index error. I also tried $HTTP_SERVER_VARS["REFERER"] which
> generates the undefined index error.
>
> What should I be using???
>
>
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>