session_start(); if ( !isset($_SESSION['S_IP']) ) { $_SESSION['S_IP'] = getenv("REMOTE_ADDR"); require_once 'includes/db.inc'; $browser = $_SERVER['HTTP_USER_AGENT']; if (getenv(HTTP_X_FORWARDED_FOR)){ $ip=getenv(HTTP_X_FORWARDED_FOR); } else { $ip=getenv(REMOTE_ADDR); } $host = @gethostbyaddr($ip); $referrer = @getenv("HTTP_REFERER"); $sql = "INSERT INTO web_stats (ip, browser, received, domain, referer) VALUES ('$ip', '$browser', now(), '$host', '$referrer')"; $results = mysql_query($sql, $connection); } ?>
|
||||||||||||||
Award and Edited Book |
|
|||||||||||||
|
||||||||||||||
2004 All rights reserved, Brook Wu |