> $fd=fopen("words.txt", "r");
Check that $fd is not 0.
> $words = fread($fd, 1000000);
>
> I then convert a string which is passed in a form to this script
>
> $FirstName=strtolower("$FirstName");
>
> And now I check to see if the lowercase version of $FirstName contains any
of
> the words from the $words
>
> if ($FirstName=="$words")
> {
> echo "Bad";
> }
>
> But it doesn`t seem to want to work, anyone give me a pointer as to where
I
> am going wrong with this??
What you have will work only if the file has *EXACTLY* the lower-case of the
$FirstName, with no newlines, and no other names in the file, and the one in
the file must not be Mixed Case.
You are probably looking for something more like this:
if (stristr($words, $FirstName)){
echo "Bad";
}
http://php.net/stristr
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]