include("connect2db.html");
$os_search = array("Windows 2000", "Windows 98", "Windows 95", "Win95", "Win98", "Windows NT 4.0", "Windows NT 5.0", "Windows NT 5.1", "Windows XP", "Windows ME", "WinNT", "Mac_PowerPC", "Macintosh", "SunOS", "Linux", "Windows NT");
$os = array("Windows 2000", "Windows 98", "Windows 95", "Windows 95", "Windows 98", "Windows NT 4.0", "Windows NT 5.0", "Windows XP", "Windows XP", "Windows ME", "WinNT", "Macintosh", "Macintosh", "SunOS", "Linux", "WinNT");
$browser_search = array("MSIE 6.0", "MSIE 5.5", "MSIE 5.0", "MSIE 4.0","Opera","Konqueror","Mozilla/5", "Mozilla/4", "Mozilla");
$browser = array("Internet Explorer 6","Internet Explorer 5.5", "Internet Explorer 5", "Internet Explorer 4", "Opera","Konqueror","Netscape 6.x", "Netscape 4.x", "Netscape");
// Search for OS
$other = 1;
while(list($key, $value) = each ($os_search)) {
$pos = strpos ($HTTP_USER_AGENT, $value);
if($pos !== false){
$OPSYS = $os[$key];
$other = 0;
break 1;
}
}
if($other != 0){ $OPSYS = "Other"; }
// Search for BROWSER
$other = 1;
while(list($key, $value) = each ($browser_search)) {
$pos = strpos ($HTTP_USER_AGENT, $value);
if($pos !== false){
$IBROWSER = $browser[$key];
$other = 0;
break 1;
}
}
if($other != "0"){ $IBROWSER = "Other"; }
$ip = $REMOTE_ADDR;
$HOSTMASK = gethostbyaddr($REMOTE_ADDR);
$agent = $HTTP_USER_AGENT;
$os = $OPSYS;
$browser = $IBROWSER;
?>
$hour = date("h") + 2; $date = $hour.date(":i A l F d S, Y"); ?>
$query = "SELECT ip, times FROM iptracker WHERE ip = '$ip' ;";
$result = mysql_query($query, $db);
$i = 0;
while($id = mysql_fetch_array($result, MYSQL_BOTH))
{
$ip["$i"] = $id["ip"];
$times["$i"] = $id["times"];
}
$times = $times[$i] + 1;
if($ip[$i] != "")
{
$query = " DELETE FROM `iptracker` WHERE `ip` = '$ip' ";
mysql_query($query);
$query = "INSERT INTO iptracker VALUES ('$date','$ip','$HOSTMASK','$os','$browser','$times')";
mysql_query($query);
}
else
{
$query = "INSERT INTO iptracker VALUES ('$date','$ip','$HOSTMASK','$os','$browser','1')";
mysql_query($query);
}
?>
|
|
 |
|
|
|

|
 |
if($admin == "loggedin") { ?>
} else { ?>
} ?>
|
|
|
 |