Page 1 of 1

Code that redirects someone to another page if on IP list

Posted: Tue Oct 28, 2003 3:33 pm
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.

Posted: Tue Oct 28, 2003 3:48 pm
by FormatteD_C
oh the the PHP version is 4.2.3

Posted: Tue Oct 28, 2003 5:50 pm
by qads
you could open the file and load the contents in a array and then use in_array() function to find out