Currently I have a file called \"hits.php\" and on any page I want to track page hits I just use
How can I track u
The simplest method would be cookie checking.
A better way would be to create an SQL database and assign the IP address as the primary key. Then whenever a user visits, you would insert that IP into the database.
$_SESSION['logged'] which you can assign whatever 'flag' you want.$_SESSION['logged'] returns 'false' then insert their IP address into the MySQL database.$_SESSION['logged'] to 'true' so you don't waste resources logging the IP multiple times.Note: When creating the MySQL table, assign the IP address' field as the key.