Code that redirects someone to another page if on IP list

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
User avatar
FormatteD_C
Forum Newbie
Posts: 10
Joined: Tue Oct 21, 2003 5:08 pm
Location: Ohio
Contact:

Code that redirects someone to another page if on IP list

Post by FormatteD_C »

Hi,
I have a PHP script on a sign up form page and the script logs the person's IP and saves it to a text file, that all works well and good. I need a script that when someone that has already been to that page and there IP is obviously in the text file gets sent to another page, what I will be using this script for is to to cut down on spamming the form page.
So what I basically need is this script to search the IP list and if there IP isn't on the list it lets the person view the page that this script will be on, but if they are on the list, it sends them to another page. I know this doesn't work with people with dynamic IPs but it will make it harder for them and it will definately cut down on spamming, thanks.
User avatar
FormatteD_C
Forum Newbie
Posts: 10
Joined: Tue Oct 21, 2003 5:08 pm
Location: Ohio
Contact:

Post by FormatteD_C »

oh the the PHP version is 4.2.3
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

you could open the file and load the contents in a array and then use in_array() function to find out
Post Reply