|
Posted by Marcin Dobrucki on 10/04/02 11:51
David Haynes wrote:
> I don't see how 'if (!email || !phone) redirect;'
> handles this case:
>
> "if there is no email present, I want it to check if there is a
> phonenumber entered, and if _both_ those conditions are false,
> then I want to redirect."
>
> The || would say that you will redirect if *either* email or phone is
> not set.
Yes, indeed. I guess I misinterpreted. Or maybe not. The original
post said:
"Today I check for the existence of an email-address, and a validation
code - what I need is a way to check, eg. whether email _or_ phone is
entered, and if none is entered, display an errorpage."
So if you take it that both email and phone must be present and
valid, then "&&", if you take it that either of the email or phone must
be valid, then its "||". In either case, the rest of it is the same.
/m
[Back to original message]
|