Modified version. hit count with the IP and Date. This PHP code will track view count only in the database, echo is not added to display on the page itself the table in MySQL should be date | IP | views
There is a problem on IP validations. By the way of how internet works, multiple users could hit a server with the same IP. For example, I work on a company that has an intranet of 1000 people, all of them travels to the internet with the same public IP
is there a way to put the php code on my index, but have it display the results on another page entirely? (kinda like a private way to view my view count) put code on index html, then results on viewcountpage. php? edit: i got it working, but half assed it... i used link rel stylesheet, but instead of loading a css file, it loads the php file :P otherwise i'd have had to change the index html into index php (i dont wanna do that), or use htaccess to parse php in the html, which i'm not sure would have gone well with some other stuff... i dunno... if there's a better way, lemmy know. also what privilages should i enable (minimum amount) for this? alter, create, create-temp-tables, delete, event, index, lock tables, select, trigger, alter routine, create routine, create view, drop, execute, insert, reference, show view, update.
Please I want u to help me code something but not really related to this tutorial. I have a login system that I want to to include let say 5 click to earn buttons so that it gives out 10points each and the values will be sum up in the dashboard and even if the user login with another phone the values will still be there and it will keep incrementing as he clicks the buttons please am counting on you Or if you know any link to get this type of tutorial you can help me out
@Cyber Investigation unique visit should be for the same date and the same page, if the same IP visits again, on different date the visit should be counted again not discarded, what do you think?
@@YaserRiaz shouldnt he then just make an if condition to check if the last visit date and the current date are the same or not ? if so then dont do anything .. but if they're arent the same then update the last visit date to the current date and increase the counter ? and ofc make a counter for each page if its a blog or smth
Hi, I follow your video exactly, all good until the part with $visitor_ip=$_SERVER['REMOTE_ADDR']; It gives me an error "Retriving Query Error SELECT * FROM counter_table WHERE ip_address='::1' " . Pls help!!