Re: empty and isset

From: Date: Thu, 06 Feb 2003 05:01:53 +0000
Subject: Re: empty and isset
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-134541@lists.php.net to get a copy of this message
ok i dont know if this will help at all since the code that doesnt work wont fit in the message (got error saying i cant send that much all at once) this is what i got out of var_dump.. first set of variables: $member[Areacode1]=string(3)"123" 123 $member[Exchange1]=string(3)"123"123 $member[Number1]=string(4)"1234"1234 those variables im not worried about because they are required in the form. the next ones i want to exclude from the list all together if string()==0 on all 3 variables.. here is the var dumb from them: $member[AreaCode2]string(0)"" $member[Exchange2]string(0)"" $member[Number2]string(0)"" here is the seudo code for what i need to do: if $member[AreaCode] & $member[Exchange2] & $member[Number2] is empty, null =="" or has string(0) in it { //exclude vars from list alltogether } any other conditions{ //print the vars in the list } ----- Original Message ----- From: "John W. Holmes" <holmes072000@charter.net> To: "'Sunfire'" <rusty_81@msn.com>; <php-general@lists.php.net> Sent: Wednesday, February 05, 2003 9:57 PM Subject: RE: [PHP] empty and isset > They both work, you're just not using the correct logic or something. > Show your code again... your actual code that isn't working (so you say) > and the form that's being submitted. Also, is register_globals on or > off? > > Load this small bit of code as proof that it works: > > <form method="POST"> > <input type="text" name="name"> > <input type="submit"> > </form> > <? > if(isset($_POST['name'])) > { > echo "You submitted a name "; > if(empty($_POST['name'])) > { echo "that was blank."; } > else > { echo "of {$_POST['name']}"; } > } > ?> > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > > -----Original Message----- > > From: Sunfire [mailto:rusty_81@msn.com] > > Sent: Wednesday, February 05, 2003 8:08 PM > > To: php-general@lists.php.net > > Subject: [PHP] empty and isset > > > > i tried to use empty and isset to check and see if variables were > being > > used > > in a form.. im not getting any kind of good answer from the server > when i > > try using empty and isset... it all works the same and that is cut out > > anything regardless of if it was used or not... > > > > > > any thing to help? > > the docs didnt seem to be much help and im sort of confused > > > > > > > > > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/11/2003

« previous php.general (#134541) next »