469,632 Members | 1,772 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,632 developers. It's quick & easy.

strange problem with netscape, opera and pageviews

i'm trying to count pageviews on my website. this is part of the code
included in each page:
$query = mysql_query("SELECT * FROM pageviews WHERE datei =
'$datei'");

if(mysql_num_rows($query) != 0)
{
$query = mysql_query("UPDATE pageviews SET hits = hits + 1 WHERE
datei = '$datei'");
}
else
{
$query = mysql_query("INSERT INTO pageviews SET datei = '$datei',
hits = '1'");
}

the "hits" field in the database is incremented every time a page gets
hit. this works fine with IE and mozilla firefox, but NN and opera
count a page twice when you load for the first time. i figure that
somehow a reload is triggered, but i don't know how.

the page contains javascript also, but even without it it counts
twice.

anyone any ideas??

micha
Jul 17 '05 #1
0 1231

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by ddt_rock | last post: by
3 posts views Thread by Harlan Messinger | last post: by
4 posts views Thread by Andrew Poulos | last post: by
17 posts views Thread by George Hester | last post: by
26 posts views Thread by Roger Desparois | last post: by
9 posts views Thread by Peter Jenkins | last post: by
7 posts views Thread by Joe | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.