Re: if/else statement, form-check
- From: Marcin Dobrucki <Marcin.Dobrucki@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 13:43:22 GMT
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
.
- References:
- if/else statement, form-check
- From: Ørjan Langbakk
- Re: if/else statement, form-check
- From: BKDotCom
- Re: if/else statement, form-check
- From: Ørjan Langbakk
- Re: if/else statement, form-check
- From: David Haynes
- Re: if/else statement, form-check
- From: Marcin Dobrucki
- Re: if/else statement, form-check
- From: David Haynes
- if/else statement, form-check
- Prev by Date: Re: PHP email function
- Next by Date: Creating pics on the web
- Previous by thread: Re: if/else statement, form-check
- Next by thread: Re: if/else statement, form-check
- Index(es):
Relevant Pages
|