Small Problem - could you help me, please?

From: Date: Wed, 17 Mar 2004 22:46:52 +0000
Subject: Small Problem - could you help me, please?
Groups: php.general 
Request: Send a blank email to php-general+get-180761@lists.php.net to get a copy of this message
I have a small problem with the script - could you hepl me, please? I made small "kicking system" for those who tried to guess the Login information. The script below is just a part of the code, but it's not working properly. I tried to solve this problem in many ways, but I couldn't. This script should check if the visitor's IP is listed in log.txt file and if it is, the warning appears. But the problem is that the script checks only first line in the log.txt file, not all the lines. P.S. log.txt file has many IP addresses listed in one column. $ip = getenv ("REMOTE_ADDR"); function kick() { $file_ip = file("log.txt"); foreach($file_ip as $value_ip ) { $kick .= "$value_ip"; } return $kick; } if ($ip == kick()){ echo "Sorry, the access is denied."; exit; } Sorry for my bad english, Thanks, Lab.

« previous php.general (#180761) next »