Re: [PHP] How to check if vaiable is defined or not?
On Mon, Feb 12, 2001 at 11:21:45PM -, SED wrote: > I'm sending a form, with check-boxes, via post to PHP-script and if the > boxes are not checked they don't post value for its variable - Can I check > with a function if the variable is defined? (or should I focus on another > solution?) php.net/isset -Egon -- http://www.linuxtag.de/ http://php.net/books.php http://www.concert-band.de/ http://www.php-buch.de/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to check if vaiable is defined or not?
try: isset($var); return true is variable is set, false otherwise. Check www.php.net for more info. Reuben D. B At 11:21 PM 2/12/01 +, SED wrote: >Hi, > >I'm sending a form, with check-boxes, via post to PHP-script and if the >boxes are not checked they don't post value for its variable - Can I check >with a function if the variable is defined? (or should I focus on another >solution?) > >Regards, >Sumarlidi Einar Dadason > >SED - Graphic Design > >-- >Phone: (+354) 4615501 >Mobile: (+354) 8960376 >Fax: (+354) 4615503 >E-mail: [EMAIL PROTECTED] >Homepage:www.sed.is <- New Homepage! >-- > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] How to check if vaiable is defined or not?
if (isset($var)) > -Original Message- > From: SED [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 12, 2001 6:22 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How to check if vaiable is defined or not? > > > Hi, > > I'm sending a form, with check-boxes, via post to PHP-script and if the > boxes are not checked they don't post value for its variable - Can I check > with a function if the variable is defined? (or should I focus on another > solution?) > > Regards, > Sumarlidi Einar Dadason > > SED - Graphic Design > > -- > Phone: (+354) 4615501 > Mobile: (+354) 8960376 > Fax: (+354) 4615503 > E-mail: [EMAIL PROTECTED] > Homepage:www.sed.is <- New Homepage! > -- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to check if vaiable is defined or not?
try using isset() or empty() see the php manual for more details Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "SED" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 13, 2001 4:51 AM Subject: [PHP] How to check if vaiable is defined or not? > Hi, > > I'm sending a form, with check-boxes, via post to PHP-script and if the > boxes are not checked they don't post value for its variable - Can I check > with a function if the variable is defined? (or should I focus on another > solution?) > > Regards, > Sumarlidi Einar Dadason > > SED - Graphic Design > > -- > Phone: (+354) 4615501 > Mobile: (+354) 8960376 > Fax: (+354) 4615503 > E-mail: [EMAIL PROTECTED] > Homepage:www.sed.is <- New Homepage! > -- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] How to check if vaiable is defined or not?
There's also possible to do a simple "try" if($variable) echo 'It contains something'; else echo 'Has nothing inside, unless it's a 0'; Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Ankur Verma [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 13, 2001 3:29 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] How to check if vaiable is defined or not? try using isset() or empty() see the php manual for more details Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "SED" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 13, 2001 4:51 AM Subject: [PHP] How to check if vaiable is defined or not? > Hi, > > I'm sending a form, with check-boxes, via post to PHP-script and if the > boxes are not checked they don't post value for its variable - Can I check > with a function if the variable is defined? (or should I focus on another > solution?) > > Regards, > Sumarlidi Einar Dadason > > SED - Graphic Design > > -- > Phone: (+354) 4615501 > Mobile: (+354) 8960376 > Fax: (+354) 4615503 > E-mail: [EMAIL PROTECTED] > Homepage:www.sed.is <- New Homepage! > -- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]