Monday, 30 November 2015

41_remember_user_ip_address

UNIQUE HIT COUNTER


The concept of unique hit counter is to remember/recording the user IP address.


1) Create homeunique.php, find_ip_address.php, remember_user_ip.txt and initialize some of the ip address.











2) Open find_ip_address.php and write the code as specify below.


3) Remember one thing in mind is if you read the data line by line basis the system will automatically place ONE BLANK SPACE.




4) Open homeunique.php files and write the code as specify below and run the page






















5)Here what we want is if found is false, means ip address not found then we want to increment our user number hit as well as append the current ip address in to remember_user_ip.txt file. So again we need to make some of the changes in our find_ip_address.php file.






6) For Checking purposes remove all the data from remember_user_ip.txt file and put zero in find_visit.txt file. Now run home_unique.php file nothing is going to display but if you check your both the text file then counter is incremented and user ip address is appended.



No comments:

Post a Comment