hi i tried the code below as well as empty and isset and it seems that even if the variables that have valid data in them they also get excluded from display with the empty ones.. does "" mean any string? or is it the normal empty string? i need to know if the vars that dont get filled in from the form are empty or not... and this isnt working very will... any idea why this happens? ps if i put & or && between if statements it gives me a parse error...
----- Original Message ----- From: "Sunfire" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 05, 2003 2:40 PM Subject: Re: [PHP] empty variables from a form > 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" <[EMAIL PROTECTED]> > To: "Sunfire" <[EMAIL PROTECTED]> > 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 > > > -- > 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/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php