<?php
include("db_connect.php");
include("web_track.php");
$webConn = new tracker();
$ipAddress = $webConn->ipAddress;
$postDate = $webConn->postDate;
$postTime = $webConn->postTime;
$dbConn = new database();
$dbConn->query("select * from tb_ipaddress");
if($dbConn->num_rows()>0){
while($dbConn->movenext()){
$dbIP = $dbConn->getfield("ipID");
$dbIpAddress = $dbConn->getfield("ipAddress");
}
}
if($dbIpAddress != $ipAddress){
$dbConn->query("insert into tb_ipaddress (ipaddress, postDate, postTime) values('$ipAddress','$postDate','$postTime')");
}
else{
$dbConn->query("update tb_ipaddress set ipAddress = '$ipAddress', postDate = '$postDate', postTime = '$postTime' where ipID = '$dbIP'");
}
?>
|