I am coding a script, that will restrict multiple access for a particular user from a given IP address. In other words, a given user will only be able to access/view the page one time from the same IP address.
But how do I compare the incoming IP’s to detect this kind of access?
I want to Track IPs for 60 days max.
You’ll need to store IPs in a database or flat file somewhere for comparison.
Let’s imagine you have a MySQL table
visitssuch as this:Using PHP we can get the user’s IP, create or update a table record in the database, and then do some comparison.