I have been stuck on this for a while and can't figure it out.
I use this code to record visits and everytime the page is loaded once it inserts two rows, 1 unique and 1 non unique, how is that?
$check = mysql_query("SELECT ip FROM visits WHERE ip = '{$_SERVER['REMOTE_ADDR']}'");
$num= mysql_num_rows($check);
if ($num< 1){
mysql_query("INSERT INTO visits VALUES('','{$_SERVER['REMOTE_ADDR']}','1')");
}else{
mysql_query("INSERT INTO visits VALUES('','{$_SERVER['REMOTE_ADDR']}','0')");}
I know its not the best script to count visits because of ip changes and such but thats a different story, just wondering why this inserts twice on a page load
When i move the code to a separate file without any HTML to test it with fake ip and such it works, what kind of html on the page could cause this?