Hit counter updating once per IP - IP HIT COUNTER


Posted on 16th Feb 2014 07:03 pm by admin

I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..
$views = $row['views'] + 1;
Then insert $views into the database.
Did you know?Explore Trending and Topic pages for more stories like this.

This updates the view for each refresh of the page, and more than once per IP.
I am confused as to how I'll check for IP. When a tutorial is posted, it has the IP of the person who posted it aswell as their username.
If I checked if the IP isn't in the database on that tutorial, to ip view status. That means that the person who posted the tutorial couldn't update the view on there.. visit to there tutorial. Though other visitors could update the view status on each refresh.

I am not sure how to do it. The database table has these fields:
Username Tutname Tutorial TimePosted IP Views

Any idea how I'd do it so that "Views" updates by +1 ONCE per visit by IP.
No comments posted yet

Your Answer:

Login to answer
304 Like 53 Dislike
Previous forums Next forums
Other forums

Need help with simple code, back and forward buttons.
Basically, I have a set of pages in a folder, which have the title somephrasehere_09.php, somephrase

Validation
Hello

I know this is a really vag question.

I need to have a input field on a form th

Sort a two dimensional array.
Hi. I've set up a two dimensional array that reads as follows:

Code: $modifiedData = array(

PHP arrays into arrays need help
Hello
I am trying to highlight the days on my calendar based on the dates that i have in my datab

Web Host List
Here is a list of web hosts that offer PHP and MySQL. It is no where near a full list, but it is mos

Running a cron job through PHP/Apache?!
Hello all,
I have a PHP script which makes a cron file from user input. When i try to run the cro

How to make a input/output field with multiple lines
Hello.
I put a input/output field on the screen but I could not change height of it. I need to

How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.

H

pop3 and fsockopen
So I am able to connect to the pop3 server, log in, and check how many messages there are. I am hav

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash