just got help with making my code for pageviews work... and now i would like the pageviews only count 1 for each session / ip.
In my users (news.users) table i have these cells available for use: (tried to set up something earlier that didnt work out so these are not in use)
ip_reg, ip_visit, dtreg, dtvisit, visits, pass
The code i have that is now working looks like this :
//Adds one to the counter
mysql_query("UPDATE news SET posts = posts + 1, published=published, last_edit=last_edit WHERE id=$id");
//Retreives the current count
$count = mysql_fetch_row(mysql_query("SELECT posts FROM news WHERE id=$id"));
//Displays the count on your site print
echo "<label>Viewed: ";
echo $count[0];
echo " times</label>";
?>
Can i use some of the unused cells in users to stop a user from reloading the page to get higher views on a page? And how do i do it :P