-Original Message-
From: Sunfire [mailto:[EMAIL PROTECTED]]
Sent: 06 February 2003 21:27
actually so does empty end up testing true on an empty var...
thats because
empty thinks or string(0) is actually a string just
blank... a trick to
do with empty is use !empty which will
:
Subject: Re: [PHP] empty and isset
02/06/2003 12:31
On Thursday 06 February 2003 22:50, [EMAIL PROTECTED] wrote:
input of type text are set regardless of whether you have entered
anything.
Thus isset() returns true.
Actually, I believe it's not a matter of the input being set, but the fact
that isset() returns true on an empty variable.
It's fairly easy. isset returns true if the VARIABLE itself exists,
like if it's been declared, or set by a form. isset isn't checking the
VALUE of the VARIABLE, just if it exists. In Jason's example below,
isset returns false because the VARIABLE was never declared in some way,
shape or
cc:
Subject: Re: [PHP] empty and isset
02/06/2003 11:28
On Friday 07 February 2003 01:35, [EMAIL PROTECTED] wrote:
Thanks for clearing that up.
Hmm, it seems like you still haven't grasped it yet :)
So input of type text does a set, which makes
isset() true,
Correct.
but isset() does not return true if $var is merely empty.
Incorrect.
string(0)
}else{
//do whatever if string().. is anything else
}
- Original Message -
From: Bryan Lipscy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 06, 2003 12:20 AM
Subject: RE: [PHP] empty and isset
Env: Slackware 8.1, Apache 1.3.27, PHP 4.3.0
Bugs: None found
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 06, 2003 9:50 AM
Subject: Re: [PHP] empty and isset
Actually, I believe it's not a matter of the input being set, but the fact
that isset() returns true on an empty variable
They both work, you're just not using the correct logic or something.
Show your code again... your actual code that isn't working (so you say)
and the form that's being submitted. Also, is register_globals on or
off?
Load this small bit of code as proof that it works:
form method=POST
input
PROTECTED]
To: 'Sunfire' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 9:57 PM
Subject: RE: [PHP] empty and isset
They both work, you're just not using the correct logic or something.
Show your code again... your actual code that isn't working (so you say
}
- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Sunfire' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 9:57 PM
Subject: RE: [PHP] empty and isset
They both work, you're just not using the correct logic or
something.
Show your code again... your
Env: Slackware 8.1, Apache 1.3.27, PHP 4.3.0
Bugs: None found for these issues.
I am running to this same problem. The isset() function appears to have
problems with the empty text value. The empty() function sees the value
of $_POST['q1'] as expected.
So why is both isset() and empty()
PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 06, 2003 12:08 AM
Subject: RE: [PHP] empty and isset
If(!empty($member['Areacode2']) ||
!empty($member['Exchange2']) || !empty($member['Number2']))
{ echo $member['Areacode2'] . '-' . $member['Exchange2'] . '-' .
$member['Number2
On Thursday 06 February 2003 13:20, Bryan Lipscy wrote:
Env: Slackware 8.1, Apache 1.3.27, PHP 4.3.0
Bugs: None found for these issues.
I am running to this same problem. The isset() function appears to have
problems with the empty text value. The empty() function sees the value
of
Env: Slackware 8.1, Apache 1.3.27, PHP 4.3.0
Bugs: None found for these issues.
I am running to this same problem. The isset() function appears to
have
problems with the empty text value. The empty() function sees the
value
of $_POST['q1'] as expected.
So why is both isset() and
Belay that one. I figured it out. My err.
I will shut up and go back to lurk mode.
So sorry, please don't flog me.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
16 matches
Mail list logo