Re: Does not work
| From: | Justin French | Date: | Mon, 15 Jul 2002 03:21:44 +0000 |
| Subject: | Re: Does not work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107665@lists.php.net to get a copy of this message | ||
This works for me, PHP 4.1.1
Upon first loading the page, I get nothing, but when I click on "go", I get
both referrer address' echoed.
refer.php:
---
<html>
<body>
<A HREF="refer.php">go</a><BR><BR>
Page refered by
<?php
echo $HTTP_REFERER.'<br>';
echo $_SERVER['HTTP_REFERER'].'<br>';
?>
</body>
</html>
---
It's already been said but:
1. are you sure php is working (with other files, and with simple echo
"hello world!"; type stuff)?
2. use this file (phpinfo.php) to test for the existence of HTTP_REFERER:
refer.php:
---
<html>
<body>
<A HREF="refer.php">go</a><BR><BR>
Page refered by
<?php
echo $HTTP_REFERER.'<br>';
echo $_SERVER['HTTP_REFERER'].'<br>';
?>
</body>
</html>
---
Upon first loading, it will not be set, but when you click go, you have a
referer, and it is set. For me, it's listed under the Apache Environment
heading.
If you still can't get a referrer var after all that, then there's an issue
with your server (are you using apache????) or perhaps the client (browser).
because it *should* be simple.
Justin French