clicks.php
sample 1)
//add to clicks
$sql_add_clicks="INSERT INTO clicks (id, click_date, click_time, click_browser, click_ip, click_url) VALUES ($id, '$click_date', '$click_time', '$click_browser', '$click_ip', '$click_url')";
mysql_query($sql_add_clicks);
//cookie and session
SetCookie ("id", $id, time()+365*86400, "/");
session_start();
$_SESSION['id'] = $id;
sample 2)
//cookie and session
SetCookie ("id", $id, time()+365*86400, "/");
session_start();
$_SESSION['id'] = $id;
//add to clicks
$sql_add_clicks="INSERT INTO clicks (id, click_date, click_time, click_browser, click_ip, click_url) VALUES ($id, '$click_date', '$click_time', '$click_browser', '$click_ip', '$click_url')";
mysql_query($sql_add_clicks);
I use the above codes to record the clicks., include the clicks.php on the top of the pages that I want to record clicks. But it seems I click once and the when I checked the database, it was recorded as two clicks in 90% cases. The two clicks happend with 2 or 3 mini seconds time gap.
At first I thought it was due to the position I put the session_start or setCookie, but it was not.
Does it has something to do with the proxy or firewall set up?
Please help!