Reply to Re: if/else statement, form-check

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация