I couldn't think of isset, so I winged it:

if (strlen($var) > 0) {...}

Phil

"Michael Sims" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Sat, 4 Jan 2003 19:26:02 -0500, you wrote:

>Whenever the form variable is equal to 0, the value is not passed into the
corresponding variable.
>
>For example, if isLogin = 1, then $isLogin = 1
>But if isRegistered = 0 then $isRegistered = {null}
>
>I do not understand why this happens, someone enlighten me!

That's just the way empty() works.  Strings which evaluate to false
(either an empty string or the string '0') will cause empty() to
return true.  Therefore if you have a form where '0' is a valid value,
empty() is not appropriate.

Instead of:

if (!empty($var)) { ... }

use:

if (isset($var) && $var != '') { ... }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to