"99999") exit; $abspath = dirname(__FILE__); require "$abspath/config.php"; $mysql = mysql_pconnect ("$mysqlhost", "$mysqllogin", "$mysqlpassword"); if($mysql != false) $mydb = mysql_select_db ("$mysqldb"); if($mydb != false && $id!="") { if($stat_include=="1") $site = explode("?",$SCRIPT_NAME); else $site = explode("?",$HTTP_REFERER); $url = $site[0]; $month = date("n"); $year = date("Y"); if($url!="") { $SQL = mysql_query("SELECT * FROM st_site WHERE site='$url' AND year='$year' AND month='$month' AND ID='$id'"); if (mysql_num_rows($SQL)>"0") mysql_query("UPDATE st_site SET hits = hits + 1 WHERE site='$url' AND year='$year' AND month='$month' AND ID='$id'"); else mysql_query("INSERT INTO st_site SET ID='$id',month='$month',year='$year',site='$url',hits='1'"); } } mysql_close ($mysql); ?>