To verify the existence of both a name and message, try a test similar to
the following:

if ((email_is_valid($email)) && (strlen($name) > 0) && (strlen($name) > 0))
{ ... }

I've found that using "" in a conditional block tends to be a bit buggy.
strlen() seems to be pretty solid for verifying the existence of text in a

Mike Frazer

"Toke Herkild" <[EMAIL PROTECTED]> wrote in message
> I've made a script which ought to validate if there is data in the fields
> not... but it doesn't seem to work...
> the validation is following:
> if ((email_is_valid($Email)) and ($Name != "") and ($Message != "")){
>   do stuff ...
> }
> But even if I submit an empty form it executes "do stuf..."
> I have tried to put an empty space into the $Name and $Message test but
> doesn't seem to do any difference either...

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to