Redirect IP after x visits

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psmith
Forum Newbie
Posts: 2
Joined: Wed Apr 28, 2010 8:03 am

Redirect IP after x visits

Post by psmith »

Please help I'm tring to write some PHP code to insert visitors IP in to SQL.

If ip xx.xx.xx.xx visits webpage (x) times redirect to (x page)

Is anyone willing to help me?
psmith
Forum Newbie
Posts: 2
Joined: Wed Apr 28, 2010 8:03 am

Re: Redirect IP after x visits

Post by psmith »

Found a solution but it works on sessions rather then inserting in sql so can expire....

http://uclue.com/?xq=874

So along the lines of this script (though would like to see if person reachs x hits will permanently block access)
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Redirect IP after x visits

Post by Jonah Bron »

You can't trust IP addresses. A system like that can be spoofed with Tor. Plus, most people have dynamic IPs. If you log a person as having seen the page n times, his IP changes, and someone else get's that IP, they won't be able to see it at all.

I think the anonymity of the internet makes this sort of thing nearly impossible. The only way that I know of, is to make them sign up so that you have their email address.
Post Reply