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. 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 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"; } 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
Archived
This topic is now archived and is closed to further replies.