Re: [PHP] if elseif elseif elseif....

2009-03-07 Thread Paul M Foster
On Sun, Mar 08, 2009 at 03:03:33PM +1100, Naz wrote: > > Generally, the approach I take is as follows: > > $errors = array(); > if (empty($_POST['name'])) >array_push($errors, 'A name was not entered.'); > if (empty($_POST['address'])) >array_push($errors, 'An address was no supplied.'); >

Re: [PHP] if elseif elseif elseif....

2009-03-07 Thread Naz
PJ wrote: This is probably a mysql question, but their list is rather dull - I think they don't appreciate my humor. Beside this list is fun ... and informative. Anyway, I can't figure this out. I am trying to verify inputs on a form and even if I have all the required fields right, I still get t

Re: [PHP] if elseif elseif elseif....

2009-03-05 Thread Al
Al wrote: PJ wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() cond

Re: [PHP] if elseif elseif elseif....

2009-03-05 Thread chris smith
>>> $obligatoryFieldNotPresent=null; >>> >>> foreach($_POST, as $value) >>> { >>>        if(!empty($value)continue; >> >>     Parse error.  ;-P >> > There should be no comma there. That fixes one, what about the rest? ;) -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General

Re: [PHP] if elseif elseif elseif....

2009-03-05 Thread leledumbo
Daniel Brown-7 wrote: > > On Wed, Mar 4, 2009 at 20:10, Al wrote: >> >> $obligatoryFieldNotPresent=null; >> >> foreach($_POST, as $value) >> { >>if(!empty($value)continue; > > Parse error. ;-P > There should be no comma there. See http://id2.php.net/manual/en/control-structures.

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Daniel Brown
On Wed, Mar 4, 2009 at 20:10, Al wrote: > > $obligatoryFieldNotPresent=null; > > foreach($_POST, as $value) > { >        if(!empty($value)continue; Parse error. ;-P -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hos

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Chris
finally found the problem... wrong names for string and this is what now verifies correctly if (strlen($_POST["titleIN"]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST["first_nameIN"]) == 0 ) { $obligatoryFieldNotPresent = 1; } elsei

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Al
PJ wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? F

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Shawn McKenzie
PJ wrote: > PJ wrote: >> Daniel Brown wrote: >> >>> On Wed, Mar 4, 2009 at 17:51, PJ wrote: >>> >>> >>> elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } >>> Are you certain you only wanted a single equal operator in the >>> last elseif() condi

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Chris
Shawn McKenzie wrote: Chris wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condi

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread PJ
PJ wrote: > Daniel Brown wrote: > >> On Wed, Mar 4, 2009 at 17:51, PJ wrote: >> >> >>>elseif ($obligatoryFieldNotPresent = 1) { >>>$obligatoryFieldNotPresent = 0; >>>} >>> >>> >> Are you certain you only wanted a single equal operator in the >> last e

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Shawn McKenzie
Chris wrote: > PJ wrote: >> Daniel Brown wrote: >>> On Wed, Mar 4, 2009 at 17:51, PJ wrote: >>> elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } >>> Are you certain you only wanted a single equal operator in the >>> last el

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Chris
PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it shou

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread PJ
Daniel Brown wrote: > On Wed, Mar 4, 2009 at 17:51, PJ wrote: > >>elseif ($obligatoryFieldNotPresent = 1) { >>$obligatoryFieldNotPresent = 0; >>} >> > > Are you certain you only wanted a single equal operator in the > last elseif() condition? Further, are you sure

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Daniel Brown
On Wed, Mar 4, 2009 at 17:51, PJ wrote: >    elseif ($obligatoryFieldNotPresent = 1) { >            $obligatoryFieldNotPresent = 0; >    } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a str