html question
Posted by: Mekon on 22 October 2004
I am using the following code (that I nicked off a php site) to gather info on who visits a page. What I want to do is use referrer info to identify the individual. Is it possible to use, say an 403 or 404 error page to redirect people onto the page whilst maintaining the orginal referrer info? My hope is that I can give people a fake link that uniquely identifies them. Also, is there any way I can capture the time that they hit the page?
I am trying to avoid having to make a page per participant.
I am trying to avoid having to make a page per participant.
quote:
<?
$file = "info.txt";
// add a b if you want to support windows platforms
$open = fopen( $file, "ab" ) or die ( "Operation Failed!" );
// define a $string (pipes & text optional - use whatever you want or none at all)
// also, use the $_SERVER superglobal (will work regardless of register globals settings)
$string = "user agent: " . $_SERVER['HTTP_USER_AGENT'] . " | remote address: " . $_SERVER['REMOTE_ADDR'] . " | http referrer: " . $HTTP_REFERER . "\n";
fputs( $open, $string);
fclose( $open );
echo $string;
?>