Re: form action problem

From: Date: Tue, 10 Jul 2001 15:14:22 +0000
Subject: Re: form action problem
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-57167@lists.php.net to get a copy of this message
> Adam, > It's really better to use the isset() instead of empty() because if you set > the error level report to E_ALL you will see that PHP will produce warnings > if the variable is not set at all! empty() and isset() are totally different. If a variable is set, but is set to nothing (or a value of 0), then the isset() will still hold true, whereas empty() will check that the variable contains a value other than a blank or 0. A workaround to the empty() statement? if ( (isset($var)) && (!empty($var)) ) { } or: if ($var!='') { } There are other ways to do this but the main point is making sure the varible is not passed as empty when the form is used. -Adam

« previous php.general (#57167) next »