http://www.php.net/manual/en/types.comparisons.php
Maybe first table PHP functions comparison (including 'isset' and 'empty')
could help you.
31.03.2013 в 8:53, John Taylor-Johnston написал(а):
> I'm using
if($mydata->>DPRresponselocationaddress1 != "")
> is this the same as
if (!isset($mydat
Io, try do like this:
You should use $_POST for the security, using $_REQUEST some users can pass a
inject or someting to crash the aplication, and addslashes is for more security
$firstName = addslashes($_POST['firstname']);
if(isset($firstName) && !empty($firstName)) {
$name = $
> if(isset($_REQUEST['firstname']) && !empty($RESULT['firstname'])) {
> $name = $_REQUEST['firstname'];
> } else {
> $name = 'Sir or Madam';
> }
>
> Can anyone see any problems with the code?
Your conditional will never evaluate to true. What is $RESULT? Where
did it come from? $RESULT is no
Thanks!
On Mon, Aug 3, 2009 at 10:13 AM, Andrew Ballard wrote:
> On Mon, Aug 3, 2009 at 1:08 PM, Allen McCabe
> wrote:
> > I created a simple survey for my work website, most of the PHP is on my
> > process.php document, which is referenced by a form on a seperate page
> > containing the form w
On Mon, 03 Aug 2009 20:11:44 +0300, "Parham Doustdar"
wrote:
Your if-statement should be like this:
[code]
if(isset($_REQUEST['firstname']) && !empty($_REQUEST['firstname'])) {
...
}
[/code]
Or even:
[code]
if(!empty($_REQUEST['firstname'])) {
...
}
[/code]
Because empty will also check
Your if-statement should be like this:
[code]
if(isset($_REQUEST['firstname']) && !empty($_REQUEST['firstname'])) {
...
}
[/code]
--
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com
"Allen McCabe" wrote in message
news:657acef20908031008nc
On Mon, Aug 3, 2009 at 1:08 PM, Allen McCabe wrote:
> I created a simple survey for my work website, most of the PHP is on my
> process.php document, which is referenced by a form on a seperate page
> containing the form with the method of "post".
>
> On my process.php page, the script obtains the
On 19 June 2009 19:53, Ashley Sheridan advised:
> On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
>> On 18 June 2009 20:25, LAMP advised:
>>
>>> using !empty() instead isset() will work if you don't care for PHP
>>> Notice: Undefined variable... If you want to avoid PHP Notice
>>> you have
>
On Sun, 2009-06-21 at 13:57 -0400, Gary wrote:
> How does echoing back to the page make it vulnerable? This does not go to a
> DB if that makes any difference.
>
> Gary
>
>
> "Paul M Foster" wrote in message
> news:20090621032151.gb14...@quillandmouse.com...
> > On Sat, Jun 20, 2009 at 12:20:
How does echoing back to the page make it vulnerable? This does not go to a
DB if that makes any difference.
Gary
"Paul M Foster" wrote in message
news:20090621032151.gb14...@quillandmouse.com...
> On Sat, Jun 20, 2009 at 12:20:56PM +0100, Ashley Sheridan wrote:
>
>> On Sat, 2009-06-20 at 00:
On Sat, Jun 20, 2009 at 12:20:56PM +0100, Ashley Sheridan wrote:
> On Sat, 2009-06-20 at 00:19 -0400, Paul M Foster wrote:
> > On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
> >
> > > On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
> > > > On 18 June 2009 20:25, LAMP advised
Yes... I echo the code onto the page as well as sending out the message.
The echo is sort of a "thank you" page, this is what you submitted. A
message, which is not going into a DB, is also emailed to the submitter and
cleint.
Gary
"Waynn Lue" wrote in message
news:d29bea5e0906181231r165c584
Waynn Lue wrote:
I notice that you're checking $_POST['mort'] but you're echoing $mort,
is that your actual code?
That was my observation as well. Is $mort = $POST['mort']; being
set somewhere else or not? If not, how is your script supposed to
know what value $mort should be?
And, what the ot
On Sat, 2009-06-20 at 00:19 -0400, Paul M Foster wrote:
> On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
>
> > On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
> > > On 18 June 2009 20:25, LAMP advised:
> > >
> > > > using !empty() instead isset() will work if you don't care
On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
> On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
> > On 18 June 2009 20:25, LAMP advised:
> >
> > > using !empty() instead isset() will work if you don't care for PHP
> > > Notice: Undefined variable... If you want to avoid PHP
On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
> On 18 June 2009 20:25, LAMP advised:
>
> > using !empty() instead isset() will work if you don't care for PHP
> > Notice: Undefined variable... If you want to avoid PHP Notice
> > you have
> > to use both:
> >
> > $msg.= (isset($_POST['mort'
On 18 June 2009 20:25, LAMP advised:
> using !empty() instead isset() will work if you don't care for PHP
> Notice: Undefined variable... If you want to avoid PHP Notice
> you have
> to use both:
>
> $msg.= (isset($_POST['mort']) and !empty($_POST['mort'])) ? "The
> mortgage amount is $mort\n"
? "The mortgage amount is $mort\n" : " ");
Yuri Yarlei.
Programmer PHP, CSS, Java, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.
> Date: Thu, 18 Jun 2009 20:07:09 +0100
> From: stut...@gmail.com
> To: gw
I notice that you're checking $_POST['mort'] but you're echoing $mort,
is that your actual code?
On 6/18/09, Gary wrote:
> I have a form that gives the submitter a choice or either one set of
> questions, or another. I am still getting the message even if the input was
> left blank. So on the li
Steve wrote:
Use !empty($_POST['mort']) instead of isset() for form input since the
form will still set an empty value if left blank.
Gary wrote:
I have a form that gives the submitter a choice or either one set of
questions, or another. I am still getting the message even if the
input was le
Use !empty($_POST['mort']) instead of isset() for form input since the
form will still set an empty value if left blank.
Gary wrote:
I have a form that gives the submitter a choice or either one set of
questions, or another. I am still getting the message even if the input was
left blank. So
2009/6/18 Gary :
> I have a form that gives the submitter a choice or either one set of
> questions, or another. I am still getting the message even if the input was
> left blank. So on the line below,
>
> $msg.= isset($_POST['mort']) ? "The mortgage amount is $mort\n" : " ";
>
> I get
>
> The m
On 8/17/07, Olav Mørkrid <[EMAIL PROTECTED]> wrote:
> how do i test if a property of a stdclass object is set, even if its
> value is null, similar to how array_key_exists() works for arrays.
>
> the following method fails:
>
> $a->b = null;
> if(isset($a->b))
> echo "yes";
>
> and property
Olav Mørkrid schreef:
how do i test if a property of a stdclass object is set, even if its
value is null, similar to how array_key_exists() works for arrays.
the following method fails:
$a->b = null;
if(isset($a->b))
echo "yes";
and property_exists() seems only to work for defined obje
On Wed, May 9, 2007 9:17 am, Davide Bernard wrote:
> Anyone got any suggestions on getting rid of these errors below?
>
>
> [Wed May 09 08:59:05 2007] [error] [client 192.168.225.246] PHP
> Notice: Undefined index: userstate in /srv/www/htdocs/resetpw.php on
> line 31, referer: https://ams.unt.
> -Original Message-
> From: Davide Bernard [mailto:[EMAIL PROTECTED]
> Sent: 09 May 2007 15:18
> To: php-general@lists.php.net
> Subject: [PHP] Isset Errors
>
>
> Anyone got any suggestions on getting rid of these errors below?
>
>
> [Wed May 09 08:59:05 2007] [error] [client 192.168
# [EMAIL PROTECTED] / 2007-04-17 13:59:39 +0200:
>
> > > The count is maintained internally as items are
> > added/removed, and it
> > > is an O(1) operation for PHP to "count" the array, as it
> > already knows
> > > the answer and just returns it.
>
>
> Hi nothing to do with the actual top
On Mon, April 16, 2007 8:06 pm, Robert Cummings wrote:
> On Mon, 2007-04-16 at 19:05 -0500, Richard Lynch wrote:
>> On Mon, April 16, 2007 6:10 pm, Jochem Maas wrote:
>> > if I know it's an array I'll definitely use empty() over count()
>>
>> > count() needs to actually count the items where a
On Tue, April 17, 2007 6:59 am, Tim wrote:
>
>> > The count is maintained internally as items are
>> added/removed, and it
>> > is an O(1) operation for PHP to "count" the array, as it
>> already knows
>> > the answer and just returns it.
>
>
> Hi nothing to do with the actual topic, i am just wo
On Tue, 2007-04-17 at 13:14 +0100, Stut wrote:
> Tim wrote:
> >
> >>> The count is maintained internally as items are
> >> added/removed, and it
> >>> is an O(1) operation for PHP to "count" the array, as it
> >> already knows
> >>> the answer and just returns it.
> >
> >
> > Hi nothing to d
Tim wrote:
The count is maintained internally as items are
added/removed, and it
is an O(1) operation for PHP to "count" the array, as it
already knows
the answer and just returns it.
Hi nothing to do with the actual topic, i am just wondering how you get this
"internals" information you
> > The count is maintained internally as items are
> added/removed, and it
> > is an O(1) operation for PHP to "count" the array, as it
> already knows
> > the answer and just returns it.
Hi nothing to do with the actual topic, i am just wondering how you get this
"internals" information
On Mon, 2007-04-16 at 19:05 -0500, Richard Lynch wrote:
> On Mon, April 16, 2007 6:10 pm, Jochem Maas wrote:
> > if I know it's an array I'll definitely use empty() over count()
> > count() needs to actually count the items where as empty() can return
> > false
> > as soon as it finds a singel
On Mon, April 16, 2007 6:10 pm, Jochem Maas wrote:
> if I know it's an array I'll definitely use empty() over count()
> count() needs to actually count the items where as empty() can return
> false
> as soon as it finds a singel element ... maybe I'm mistaken - if so
> please
> put me right.
I've been using empty() for about 5 years, obeying the rules for empty() in the
php manual
"Appendix P. PHP type comparison tables" and have never seen it generate any
type of error message.
If you guys know of at least one exception, please clue us in on it.
Jim Lucas wrote:
Stut wrote:
te
Richard Lynch wrote:
> On Mon, April 16, 2007 5:35 pm, Tim Earl wrote:
>> What about in the following context?
>>
>> $arr = array();
>> If (!empty($arr)) { }
>>
>> This is where i have found it to be the most usefull...
>
> If I'm already certain that it's an array, I just use 'count' personally.
On Mon, April 16, 2007 11:18 am, Jim Lucas wrote:
> these two lines are not the same infact, with the first, you will not
> get a E_NOTICE warning, but
> with the second you will.
I dunno what you are thinking of, but the manual says:
"empty() is the opposite of (boolean) var, except that no warn
On Mon, April 16, 2007 5:35 pm, Tim Earl wrote:
> What about in the following context?
>
> $arr = array();
> If (!empty($arr)) { }
>
> This is where i have found it to be the most usefull...
If I'm already certain that it's an array, I just use 'count' personally.
'empty' takes a mixed data type,
On Mon, April 16, 2007 11:12 am, tedd wrote:
> I've been accuse of that too, but what's your solution?
*MY* solution:
Don't use empty because its behaviour changed wrt "0" in various
versions, so it's just gonna bite you in the butt like it did me. :-)
I generally do this basic algorithm:
#1
Us
> -Message d'origine-
> De : Robert Cummings [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 16 avril 2007 20:28
> À : Edward Vermillion
> Cc : php Lists
> Objet : Re: [PHP] isset
>
> On Mon, 2007-04-16 at 13:16 -0500, Edward Vermillion wrote:
> > O
On Sun, April 15, 2007 12:07 pm, [EMAIL PROTECTED] wrote:
> I have E_NOTICE turned off. :)
Your first mistake.
:-)
E_NOTICE on is a royal pain at first, but will catch bugs for you, and
save you development time in the long run.
Turn it on for your next new project and try it.
--
Some people
On Sat, April 14, 2007 8:36 pm, Richard Kurth wrote:
> What do you do when isset does not work? If I send data in a
> $_REQUEST['var'] like
> if (isset($_REQUEST['var'])) {
> }
> Put var has no data it still says it is set. Because $_REQUEST['var']
> = ""
> and isset thinks "" is set
It *is* set.
Robert Cummings wrote:
On Mon, 2007-04-16 at 09:27 -0700, Jim Lucas wrote:
Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because
On Apr 16, 2007, at 1:28 PM, Robert Cummings wrote:
On Mon, 2007-04-16 at 13:16 -0500, Edward Vermillion wrote:
On Apr 16, 2007, at 12:30 PM, Robert Cummings wrote:
[snip]
Bleh, my mistake... I'm so adverse to empty() I forgot it doesn't
generate notices.
Strings only containing only s
On Mon, 2007-04-16 at 13:16 -0500, Edward Vermillion wrote:
> On Apr 16, 2007, at 12:30 PM, Robert Cummings wrote:
>
> [snip]
>
> >
> >
> > Bleh, my mistake... I'm so adverse to empty() I forgot it doesn't
> > generate notices.
> >
Strings only containing only spaces are not empty. Strings conta
On Apr 16, 2007, at 12:30 PM, Robert Cummings wrote:
[snip]
Bleh, my mistake... I'm so adverse to empty() I forgot it doesn't
generate notices.
Lemme guess... You don't like empty() because it thinks null/0/'' is
empty? Or is there some other reason?
Agreed, it can be tricky if you ju
On Mon, 2007-04-16 at 18:16 +0100, Stut wrote:
> Jim Lucas wrote:
> > Stut wrote:
> >> tedd wrote:
> >>> At 4:08 PM +0100 4/16/07, Stut wrote:
> Jim Lucas wrote:
> > Richard Kurth wrote:
> >> What do you do when isset does not work? If I send data in a
> >> $_REQUEST['var'] like if
Stut wrote:
Jim Lucas wrote:
Stut wrote:
tedd wrote:
At 4:08 PM +0100 4/16/07, Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. B
Jim Lucas wrote:
Stut wrote:
tedd wrote:
At 4:08 PM +0100 4/16/07, Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because
$_REQ
On Mon, 2007-04-16 at 09:27 -0700, Jim Lucas wrote:
> Stut wrote:
> > Jim Lucas wrote:
> >> Richard Kurth wrote:
> >>> What do you do when isset does not work? If I send data in a
> >>> $_REQUEST['var'] like if (isset($_REQUEST['var'])) {
> >>> }
> >>> Put var has no data it still says it is set. B
On Apr 16, 2007, at 11:27 AM, Jim Lucas wrote:
Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because $_REQUEST
['var'] = ""
a
Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because $_REQUEST['var']
= ""
and isset thinks "" is set
I use this combination
that was actually my point.
:)
-afan
Stut wrote:
tedd wrote:
At 4:08 PM +0100 4/16/07, Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it
Stut wrote:
tedd wrote:
At 4:08 PM +0100 4/16/07, Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because
$_REQUEST['var'] = ""
tedd wrote:
At 4:08 PM +0100 4/16/07, Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because
$_REQUEST['var'] = ""
and isset thi
At 4:08 PM +0100 4/16/07, Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because $_REQUEST['var'] = ""
and isset thinks "" is set
Robert Cummings wrote:
On Mon, 2007-04-16 at 09:27 -0700, Jim Lucas wrote:
Stut wrote:
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because
Jim Lucas wrote:
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because $_REQUEST['var']
= ""
and isset thinks "" is set
I use this combination a lot:
if (
Richard Kurth wrote:
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like
if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because $_REQUEST['var'] = ""
and isset thinks "" is set
I use this combination a lot:
if ( isset($_GET['somet
At 12:16 PM -0500 4/15/07, Larry Garfield wrote:
If you want your syntax to be a bit simpler, I frequently use helper functions
along these lines:
function http_get_int($var, $default=0) {
return isset($_GET[$var]) ? (int) $_GET[$var] : $default;
}
if (http_get_int('var') ==5) {
// Do stuff
ve it
would be appropriate to ignore that one warning.
-Logan
-Original Message-
From: Larry Garfield [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 15, 2007 1:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset
On Sunday 15 April 2007 12:07 pm, [EMAIL PROTECTED] wrote:
> > of co
On Sunday 15 April 2007 12:07 pm, [EMAIL PROTECTED] wrote:
> > of course it's your call whether you write/run code that spits out
> > E_NOTICEs all over the place due to usage of uninitialized vars.
>
> not quite sure. if $_GET['var'] doesn't exists it's DEFINITLY not equal to
> 'foo', right?
>
>
> Afan Pasalic wrote:
>>
>> Jochem Maas wrote:
>>> Richard Kurth wrote:
>>>
What do you do when isset does not work? If I send data in a
$_REQUEST['var'] like
if (isset($_REQUEST['var'])) {
}
Put var has no data it still says it is set. Because $_REQUEST['var']
= ""
>>
Afan Pasalic wrote:
>
> Jochem Maas wrote:
>> Richard Kurth wrote:
>>
>>> What do you do when isset does not work? If I send data in a
>>> $_REQUEST['var'] like
>>> if (isset($_REQUEST['var'])) {
>>> }
>>> Put var has no data it still says it is set. Because $_REQUEST['var'] = ""
>>> and isset
Richard Kurth wrote:
> What do you do when isset does not work? If I send data in a
> $_REQUEST['var'] like
> if (isset($_REQUEST['var'])) {
> }
> Put var has no data it still says it is set. Because $_REQUEST['var'] = ""
> and isset thinks "" is set
php -r ' $r = array("foo" => ""); var_dump(iss
D_C wrote:
I often use this type of construct
$cmd = $_POST['cmd'];
if ($cmd == null) { // do default
but this throws a notice if the ['cmd'] index is not defined. ugly.
using
if (isset($_POST['cmd'] ) {
$cmd = $_POST['cmd'];
}
seems lengthy. is there a way around this?
http://www.php.net/a
D_C wrote:
> I often use this type of construct
>
> $cmd = $_POST['cmd'];
> if ($cmd == null) { // do default
>
> but this throws a notice if the ['cmd'] index is not defined. ugly.
> using
>
> if (isset($_POST['cmd'] ) {
> $cmd = $_POST['cmd'];
> }
>
> seems lengthy. is there a way around this?
Yeah as soon as I saw this example, I figured that was the case for
example something like
if (!empty())
and so on.
d
On 16-Nov-04, at 5:26 PM, Robby Russell wrote:
On Tue, 2004-11-16 at 17:19 -0800, Dustin Krysak wrote:
Thanks!
perfect!
d
For future reference, just about any function that us
On Tue, 2004-11-16 at 17:19 -0800, Dustin Krysak wrote:
> Thanks!
>
> perfect!
>
> d
For future reference, just about any function that uses is at the
beginning should return a boolean result. So if (is_array()) can also be
checked with if (!is_array())
This should apply to all the php included
Thanks!
perfect!
d
On 16-Nov-04, at 4:13 PM, Robby Russell wrote:
On Tue, 2004-11-16 at 15:11 -0800, Dustin Krysak wrote:
Hi there.. I am pretty new to PHP, and I am familiar with php "isset"
option now i was wondering (I have looked at the PHP site -
but
can not find it) how can you check
On Tue, 2004-11-16 at 15:11 -0800, Dustin Krysak wrote:
> Hi there.. I am pretty new to PHP, and I am familiar with php "isset"
> option now i was wondering (I have looked at the PHP site - but
> can not find it) how can you check if something is not set? I need to
> test if a $_GET is n
On Nov 16, 2004, at 5:11 PM, Dustin Krysak wrote:
Hi there.. I am pretty new to PHP, and I am familiar with php "isset"
option now i was wondering (I have looked at the PHP site -
but can not find it) how can you check if something is not set? I need
to test if a $_GET is not set (not ju
On Tue, 16 Nov 2004 15:11:39 -0800, Dustin Krysak
<[EMAIL PROTECTED]> wrote:
> how can you check if something is not set?
!isset()
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
> Hi there.. I am pretty new to PHP, and I am familiar with php "isset"
> option now i was wondering (I have looked at the PHP site - but
> can not find it) how can you check if something is not set? I need to
> test if a $_GET is not set (not just empty).
>
> thanks in advance!
>
> d
>
I
[snip]
I'm new to PHP, so how would I go about using sessions?
I assume one needs to update _SESSION['name'] = $name; with the state of
the
form and then use IF ?
Then I'm stuck again!
[/snip]
start here http://www.php.net/session
P.S. Always reply to the list, you may not get a response. Your e-
[snip]
I've had the script working with two states but can't get the third
state
working!!!
Any help or alternative ideas much appreciated as this is causing me a
serious headache!!!
[/snip]
Sessions would be a better way to handle this.
--
PHP General Mailing List (http://www.php.net/)
To unsubs
David Risner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]> On Fri, 26
Mar 2004 10:40:43 -0800, "Marcjon Louwersheimer"
> <[EMAIL PROTECTED]> said:
> > Is there an easier way to do
> > isset($variable) AND $variable != NULL
> > ? I use this alot in my if statements, and I was wonder
On Fri, 26 Mar 2004 10:40:43 -0800, "Marcjon Louwersheimer"
<[EMAIL PROTECTED]> said:
> Is there an easier way to do
> isset($variable) AND $variable != NULL
> ? I use this alot in my if statements, and I was wondering if there's an
> easier way to do it, maybe with a single function? Oh and anothe
On Fri, 2004-03-26 at 13:46, Rasmus Lerdorf wrote:
> if(!empty($variable))
This will return false positives for cases where the variable has not
been set to null but HAS been set to the empty string or to a 0? This
isn't really the same as the OP requested. However, isset() also returns
false for
if(!empty($variable))
On Fri, 26 Mar 2004, Marcjon Louwersheimer wrote:
> Is there an easier way to do
> isset($variable) AND $variable != NULL
> ? I use this alot in my if statements, and I was wondering if there's an
> easier way to do it, maybe with a single function? Oh and another
> question
On 15 February 2004 18:30, Richard Davey wrote:
> I feel the book you're learning from might not be the best out there!
> Especially as it uses the horrible if : else : endif notation,
I'd have to disagree with you on that one -- personally I think that's a very elegant
and useful syntax, and al
On Monday 16 February 2004 02:30, Richard Davey wrote:
> I feel the book you're learning from might not be the best out there!
> Especially as it uses the horrible if : else : endif notation,
> includes code on the same line as the PHP tags themselves
What is horrible about that style? IMO doing
- Original Message -
From: "Richard Davey" <[EMAIL PROTECTED]>
> Hello Anthony,
> I feel the book you're learning from might not be the best out there!
> Especially as it uses the horrible if : else : endif notation,
> includes code on the same line as the PHP tags themselves and is
> tea
Hello Anthony,
Sunday, February 15, 2004, 4:43:12 PM, you wrote:
AR> Why doesn't the call to !isset() with the negation mark loads the next page
AR> when a name is not entered?
Because it's using isset() in the wrong capacity.
isset() does not check to see if a variable HAS a value, it checks t
This should help:
http://www.php.net/manual/en/function.array-key-exists.php
Cheers,
Rob.
On Fri, 2003-08-22 at 13:26, Curt Zirzow wrote:
> * Thus wrote Christian Calloway ([EMAIL PROTECTED]):
> > Ok, here's the deal. I like to use $_GET and $_POST variables without values
> > to notify my
What I was trying to avoid is exactly that. It would require changing links
and hidden fields throughout the entire application, which would take hours
to track down. I am looking for a nice lazy and easy fix.
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrot
* Thus wrote Christian Calloway ([EMAIL PROTECTED]):
> Ok, here's the deal. I like to use $_GET and $_POST variables without values
> to notify my scripts that some action must be taken. For example, given the
> following URL:
>
> http://blahdomain/blah.php?productid=1&edit
>
> or given the follo
On Thursday 10 July 2003 21:53, Denis L. Menezes wrote:
> I have the following code :
>
> Quote:
>
> if (isset($SenderEmailAddress)){
> mail($mailTo, $mailSubject, $Message);
> }
>
> Unquote
>
> All I want to do is that , if the $SenderEmailAddress is not entered, the
> mail() function shou
... or:
if(!empty($SenderEmailAddress))
{
...
}
Dean E. Weimer wrote:
> What about the rest of the code? How is this variable defined? I
> have had this happen in some code before, I found that the variable
> was set to "". Try using:
>
> if (isset($SenderEmailAddress) && $SenderEmailAddress !
What about the rest of the code? How is this variable defined? I have
had this happen in some code before, I found that the variable was set to
"". Try using:
if (isset($SenderEmailAddress) && $SenderEmailAddress != "") {
mail($mailTo, $mailSubject, $Message);
}
> I have the following code :
On Tuesday 01 July 2003 12:46, John Manko wrote:
> Hello everyone. I was able to determine what was causing my problem
> with session variables not being persitant across page requests. I want
> to give you the full scope here, so I'm going to paste the code (and if
> you have any code tips, plea
Hello everyone. I was able to determine what was causing my problem
with session variables not being persitant across page requests. I want
to give you the full scope here, so I'm going to paste the code (and if
you have any code tips, please let me know).
I think the problem might be this (a
$output_fname = (isset($HTTP_POST_VARS['fname'])) ? $HTTP_POST_VARS['fname']
: '';
but the value WILL be set regardless... in this case i'd prefer:
if(isset($HTTP_POST_VARS['fname'])) { $output_fname =
$HTTP_POST_VARS['fname']; }
alternatively, I wrote a nice function to pluck out $_POST vars o
Why is my script autopopulating a "1" in the field names and not the orginal
values ?
Is it something to do with this statement ?
$output_fname = isset($HTTP_POST_VARS['fname']);
Im declaring the var and using it in value field in my form. I know that I
missing something. Its returning true when
It depends on what you're trying to test.
If you want to find out if a variable is explicitly set to an empty
string, then isset() is not your answer. If you want find out if a
variable exists or is set to a non-null value, isset() will work.
However, it is not always going to give you the results
Responding to myself:
<>
Conversely, what about empty(). Is that a better test for if a value could
be 0 or 1 or 2 or ABC?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Sun, 10 Nov 2002 18:34:52 -0600, you wrote:
>PS: what is the proper term for the "->" syntax? pointer?
In Perl it's called an infix operator. I think in PHP the technical
term for it is that "->" thingy... :-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://ww
> That's because isset() is expecting a variable, not a function. In your
> first example, you're trying to see if a function is set, not a
> variable. In your second example, you're doing it right...
>
> ---John Holmes...
That actually makes sense once I thought about it, a function referencing
> I don't know if this is a bug, or what, but I get an error when trying
the
> following
>
> if ( isset($adodbobject->Fields('myresult') ) ) { // do something }
>
> PHP throws an error ( not warning ) saying:
> Parse error: parse error, expecting `','' or `')'' in
/path/to/index.php
> on
> line 45
I had given a try on your code, But it really output "1", a true value.
I used "PHP 4.2.2+Apache 1.3.26" under Win2K. And u?
- Original Message -
From: lallous
Sent: 2002Äê8ÔÂ3ÈÕ 16:19
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var) && !empty($v
1 - 100 of 149 matches
Mail list logo