MartinCouture
Technical User
I'm playing around with REFERER and have problems with my index.php page...
but when you read the text file, referer.txt, I have 25/02/02 23:10 : Referer = | Host = localhost:8080 | URL = /index.php
instead of the previous web page visited. I always make sure I visit at least 2 or 3 different web sites before accessing index.php.
Here's the structure of index.php (structure is the probable cause )
This should fill the text file with all the referer sites, right ?
I also tried straight $HTTP_REFERER with the same results...
Help !
Code:
$refererFile = "scripts/counter/referer.txt";
$referer = getenv("HTTP_REFERER");
$host = getenv("HTTP_HOST") ;
$url= getenv("REQUEST_URI");
$logEntry=strftime("%d/%m/%y %H:%M",time())." : Referer = $referer | Host = $host | URL = $url\n";
$file = @fopen($refererFile, "a");
fwrite($file, $logEntry);
fclose($file);
but when you read the text file, referer.txt, I have 25/02/02 23:10 : Referer = | Host = localhost:8080 | URL = /index.php
instead of the previous web page visited. I always make sure I visit at least 2 or 3 different web sites before accessing index.php.
Here's the structure of index.php (structure is the probable cause )
Code:
<HTML>
<HEAD>
<TITLE>Index Page</TITLE>
</HEAD>
<?
$refererFile = "scripts/counter/referer.txt";
$referer = getenv("HTTP_REFERER");
$host = getenv("HTTP_HOST") ;
$url= getenv("REQUEST_URI");
$logEntry=strftime("%d/%m/%y %H:%M",time())." : Referer = $referer | Host = $host | URL = $url\n";
$file = @fopen($refererFile, "a");
fwrite($file, $logEntry);
fclose($file);
?>
<FRAMESET cols="185,*" FRAMEBORDER="0" BORDER=0>
<FRAME SRC="menuindex.html" NAME="nav" marginwidth="0" marginheight="0" target="body">
<FRAME SRC="mainindex.php" NAME="body" marginwidth="0" marginheight="0" target="body">
</FRAMESET>
<NOFRAMES>
<BODY>
You need a frame capable browser ! Update your browser...
</BODY>
</NOFRAMES>
</HTML>
This should fill the text file with all the referer sites, right ?
I also tried straight $HTTP_REFERER with the same results...
Help !