diff --git a/idea.php b/idea.php index b98caba..8f54b0e 100755 --- a/idea.php +++ b/idea.php @@ -1,19 +1,26 @@ "; - $user = fgets($myfile); - if ($user == $check) { - $ok = true; - } - $i++; + $pattern = '/\s*/m'; + $replace = ''; + if ($handle) { + while (($line = fgets($handle)) !== false) { + // process the line read. + $line = preg_replace( $pattern, $replace, $line); // remove any spaces + if ($line == $check) { + $ok = true; + } } - fclose($myfile); - if ($ok) { + fclose($handle); +} else { + // error opening the file. + echo "
E 100"; + return false; +} + if ($ok == true) { return true; } else { return false; @@ -43,4 +50,4 @@ function getIP() { $ip = $_SERVER['REMOTE_ADDR']; } return $ip; -} \ No newline at end of file +}