Re: empty variables from a form

From: Date: Wed, 05 Feb 2003 19:40:51 +0000
Subject: Re: empty variables from a form
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-134469@lists.php.net to get a copy of this message
tnx will try that my other code looked something like that but it didnt work.. probably had the (and ) in the wrong places... i set it up as the whole statement as 1 if statement not 3 different ones.. ----- Original Message ----- From: "Erich Beyrent" <Erich.Beyrent@chron.com> To: "Sunfire" <rusty_81@msn.com> Sent: Wednesday, February 05, 2003 1:54 PM Subject: Re: [PHP] empty variables from a form > > hi.. > > > > how would you test for an empty (unused) variable from a form.. > > i have a phone number split into 3 different vairiables and want to test > to > > see if they were used in the form before displaying either the phone > number > > itself or just leaving it out of the display... what code would be good to > > test it with.. the variables are $ac2 $ext2 and $num2 > > Use the isset() function: > > if(isset($ac2)) and > if(isset($ext2)) and > if(isset($num2)) { do something } > else { do something else } > > -Erich- > > > > > --- 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

« previous php.general (#134469) next »