require("./admin/bitlog.inc") ; $gifdata = base64_decode("R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==") ; // 1x1 transparent GIF data, nothing special! header("Content-type: image/jpeg"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache"); header("Cache-Control: post-check=0, pre-check=0"); header("Pragma: no-cache"); $agent = $HTTP_USER_AGENT ; $referer = $HTTP_REFERER ; $expdate = time() + 31536000*2 ; if (!$bit) { srand ((double) microtime() * 1000000); $x = ereg_replace("\.","",$REMOTE_ADDR ) * rand(1,13) ; $bit = time() . $x ; setcookie("bit",$bit,$expdate) ; } if ($BIT_IMAGE) { readfile($BIT_IMAGE); } else { echo $gifdata ; } $ip = gethostbyaddr($REMOTE_ADDR) ; $link1 = mysql_connect ($BIT_DB_HOST, $BIT_DB_NAME, $BIT_DB_PASS) or die ("Could not connect"); mysql_select_db ($BIT_DB_DATABASE,$link1) ; if (substr($ip,-strlen($BIT_DOMAIN)!=$BIT_DOMAIN)) { $q = "INSERT INTO bitlog(ip,cookie,agent,referer) VALUES('$ip','$bit','$agent','$referer')" ; mysql_query($q,$link1) ; if ($email) { // If called like ... $q = "INSERT INTO bitlog_notes(cookie,notes) VALUES('$bit','$email')" ; mysql_query($q,$link1) ; } } mysql_close($link1) ; ?>