Vivid Lust Posted January 14, 2009 Share Posted January 14, 2009 Hi, Im looking to make an IP checker, a script which reads the IP's in a text file, and if the IP of the user exists then the script does X Ip's and text file would be separated by a new line. Any ideas how I could do this? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/140833-check-values-in-a-text-file/ Share on other sites More sharing options...
jnerotrix Posted January 14, 2009 Share Posted January 14, 2009 Here is something I made a while back it puts user ip's into a text file on a new line and won't add the same ip twice Http://mytestsite.rack111.com/counter/usertrack.zip Quote Link to comment https://forums.phpfreaks.com/topic/140833-check-values-in-a-text-file/#findComment-737125 Share on other sites More sharing options...
rhodesa Posted January 14, 2009 Share Posted January 14, 2009 $ip = $_SERVER["REMOTE_ADDR"]; $ips = file('ip_list.txt'); //Reads IPs into an array if(in_array($ip,$ips)){ echo "IP is in list"; }else{ echo "IP is NOT in list"; } Quote Link to comment https://forums.phpfreaks.com/topic/140833-check-values-in-a-text-file/#findComment-737129 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.