Re: [PHP] complex if statement for field validation

2010-06-07 Thread Jim Lucas
David Mehler wrote: > Hello, > I've got a form with three fields that are not required for proper > completion of it, ending month, day, year fields. If a user enters > nothing no problem, but if those form fields are entered I need them > validated. They have to be in the correct format -MM-DD

Re: [PHP] complex if statement for field validation

2010-06-07 Thread Ashley Sheridan
On Mon, 2010-06-07 at 16:51 -0400, David Mehler wrote: > Hello, > I've got a form with three fields that are not required for proper > completion of it, ending month, day, year fields. If a user enters > nothing no problem, but if those form fields are entered I need them > validated. They have to

[PHP] complex if statement for field validation

2010-06-07 Thread David Mehler
Hello, I've got a form with three fields that are not required for proper completion of it, ending month, day, year fields. If a user enters nothing no problem, but if those form fields are entered I need them validated. They have to be in the correct format -MM-DD date format and that value al

Re: [PHP] Complex IF statement

2001-03-23 Thread Miles Thompson
You mean if( $var == "duck" || $var == "goose" ..etc A single equal sign is assignment, double is test for equality. Check the string functions, you could try something like: if ( strpos( "duckgoosehenchickenpeacock", $var ) != 0 ) {do something} else {critter in $var not part of our set} I

Re: [PHP] Complex IF statement

2001-03-23 Thread darion mapp
try if($var = "duck" || $var = "goose"){}else{} now you should look into the switch-case function also -- On Wed, 13 Dec 2000 00:19:08 JCampbell wrote: >Thank you all for your help earlier! > >Now I need to know if it is possible to create a complex if statement? > >if ($variable=="duck") ||

RE: [PHP] Complex IF statement

2001-03-23 Thread Chris Mulcahy
if (($variable=="duck") || ($variable=="goose")) { } else { } -Original Message- From: JCampbell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 11:19 PM To: Main PHP List Subject: [PHP] Complex IF statement Thank you all for your help earlier! Now I n

Re: [PHP] Complex IF statement

2001-03-22 Thread David Robley
On Wed, 13 Dec 2000 15:49, JCampbell wrote: > Thank you all for your help earlier! > > Now I need to know if it is possible to create a complex if statement? > > if ($variable=="duck") || ($variable=="goose"){ }else{ } > > Is how I thought it would work. I just need to know if there is an easy > w

[PHP] Complex IF statement

2001-03-22 Thread JCampbell
Thank you all for your help earlier! Now I need to know if it is possible to create a complex if statement? if ($variable=="duck") || ($variable=="goose"){ }else{ } Is how I thought it would work. I just need to know if there is an easy way to do an OR in if statements IF variable equals duck o