This is kind of old-fashioned, but I created a counter that prevents hijacking.
"district" is a partial of the word in the URL. If it does not exist, echoes hijacking
...
----snip---
if(stristr($HTTP_REFERER,"district"))
{
#...
#echo "document.write(\"$num_rows visitors since August 23, 2003\");";
echo "document.write(\"<font size=-1>$num_rows visitors since August 23, 2003 referred
from: $HTTP_REFERER</font>\");";
}else{
echo "document.write(\"No hijacking from ".$_ENV["HOSTNAME"].", merci. \");";
}
----snip---
The problem is I noticed a friend was getting the hijacking message.
I had him clean his cache and reload, but no luck.
I wondered why he got that message, so I echoed $HTTP_REFERER to see what his IE6.x
was spewing out. The result was:
$HTTP_REFERER =""
Anyone suggest a work around? Another variable maybe? I don't need it, but want that
functionality in this counter:
if(stristr($HTTP_REFERER,"district"))
I do need this fucntionality, however, on another site, where two URLS share the same
index.html on the same Apache server. One displays info one way for one URL, the other
another way for a different URL.
P.S., I'm using the Javascript document.write because this site is not on a PHP
server, so I used this code to help the non-PHP site out:
<script language=javascript src='http://foo.com/counters/05200.php'></script>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php