$file="../count2.txt"; //this is the file to store..make sure not in www $rem=$REMOTE_ADDR; //ip address stored in rem variable define('HOST1', '129.21.213.194'); define('HOST2', '129.21.40.36'); $fp=fopen($file,"a"); if ($fp==NULL) $fp=fopen($file,"w"); //this is to open the file $date=strftime("%m/%d/%Y %H:%M"); //creates string from the time data (from grace) $ref=$HTTP_REFERER; //from where? $pg=$REQUEST_URI; //which page did client visit if($rem!=HOST1) { if($rem!=HOST2) { fwrite($fp,"\r\n$rem coming from $ref read $pg on $date"); //write all this stuff fclose($fp); //close the file } } header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 ?>