Re: [PHP] PHP and empty() if form value is 0

2003-01-04 Thread Michael Sims
On Sat, 4 Jan 2003 20:33:14 -0500, you wrote: >I couldn't think of isset, so I winged it: > >if (strlen($var) > 0) {...} This should work most of the time, but be aware this will produce a warning if $var isn't set (and you haven't set your error reporting level to ignore warnings)... If you're

Re: [PHP] PHP and empty() if form value is 0

2003-01-04 Thread Phil Powell
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

Re: [PHP] PHP and empty() if form value is 0

2003-01-04 Thread Michael Sims
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, someon

[PHP] PHP and empty() if form value is 0

2003-01-04 Thread Phil Powell
foreach ($HTTP_GET_VARS as $key => $val) { if (!empty($HTTP_GET_VARS["$key"])) ${"$key"} = $HTTP_GET_VARS["$key"]; } foreach ($HTTP_POST_VARS as $key => $val) { if (!empty($HTTP_POST_VARS["$key"])) ${"$key"} = $HTTP_POST_VARS["$key"]; } Whenever the form variable is equal to 0, the va