I've started a database to learn some things about visitors to my web site (things like what page they normal leave on, what items are placed into the shopping cart, ect..)
The problem i'm haveing is that I keep getting the same "visitor" (well ip address) entered into the database over and over and over again.. It's not just one ip address, but it's several. several times a day a new one shows up and hits 100+ times over a few hours.
I do not beleve this is a person browseing the site because it's always the index pages, and because the visit lasts so long.
I can just check to see if the ip address already exists in the database for that date and if so just not saveing the visitor to the database, but i would rather know what is causeing this.
Any suggestions on what might be causeing this?
a robot?
any suggestions on how to fix it?
Function checkTracking($post)
{
if($post['mode']==14){
$_SESSION['trackpurchase']=1;
}
if($_SESSION['trackpurchase']=='1'){
$purchase=1;
}
$cid=$_SESSION['cid'];
if($post['source']=='overture'){
$overture=1;
}
if($post['mode']=='4'){
$_SESSION['trackingmodes'].=$post['mode'].':'.$post['num'].'-';
}elseif($post['mode']=='6'){
$_SESSION['trackingmodes'].=$post['mode'].':'.$post['num'].'-';
}else{
$_SESSION['trackingmodes'].=$post['mode'].'-';
}
$modes=$_SESSION['trackingmodes'];
$notes=serialize($_SESSION);
$currentpage=$_SERVER['PHP_SELF'];
if($post['trackingsaved']=='yes'){
// update existing
$query="UPDATE `tracking` SET ";
$query.="`purchase` = '$purchase', ";
$query.="`cid` = '$cid', ";
$query.="`overture` = '$overture', ";
$query.="`modes` = '$modes', ";
$query.="`notes` = '$notes', ";
$query.="`currentpage` = '$currentpage' ";
$query.="WHERE `marker` = '".$_SESSION['trackmarker']."' LIMIT 1 ;";
$SQLresult=mysql_query($query);
//echo "<font color='white'>$query</font>";
}else{
// save new
$marker=time().rand(1000,9999);
$dateentered=date("Y").date("m").date("d");
$_SESSION['trackmarker']=$marker;
$ipadd=$_SERVER['REMOTE_ADDR'];
$query="INSERT INTO `tracking` (`purchase` , `cid` , `overture` , `modes` , `notes`, `marker` , `referrer`, `currentpage`, `dateentered`, `ipadd`)";
$query.="VALUES ('$purchase', '$cid', '$overture', '$modes', '$notes', '$marker', '".$_SERVER['HTTP_REFERER']."', '$currentpage', '$dateentered', '$ipadd');";
$SQLresult=mysql_query($query);
$_SESSION['post']['trackingsaved']='yes';
}
}