Re: [PHP] Re: isset question

2009-06-18 Thread LAMP
Gary wrote: This is what I have now and it works. I do know that on the second line I have $_POST['mort']}\n : ; in the second half. I'm not sure I understand the comment about use the !empty if you dont care about PHP. if you don't care about PHP Notice... eror_reporting:

Re: [PHP] Re: isset question

2009-06-18 Thread Martin Scotta
error_reporting( E_ALL | E_STRICT ); if you want to be extremely sure about your app (only in develop) On Thu, Jun 18, 2009 at 5:04 PM, LAMP l...@afan.net wrote: Gary wrote: This is what I have now and it works. I do know that on the second line I have $_POST['mort']}\n : ; in the second

Re: [PHP] Re: isset question

2009-06-18 Thread LAMP
Martin Scotta wrote: error_reporting( E_ALL | E_STRICT ); if you want to be extremely sure about your app (only in develop) Actually, I use error_reporting(E_ALL) while developing :-) Afan On Thu, Jun 18, 2009 at 5:04 PM, LAMP l...@afan.net mailto:l...@afan.net wrote: Gary wrote:

Re: [PHP] Re: isset($a-b) even if $a-b = null

2007-08-17 Thread Olav Mørkrid
the solution has been found. array_key_exists() can actually be used on objects, and yields the correct result. http://no.php.net/array_key_exists thanks to dordea cosmin for pointing this out. On 17/08/07, Olav Mørkrid [EMAIL PROTECTED] wrote: the test i need should give the following

Re: [PHP] Re: isset($a-b) even if $a-b = null

2007-08-17 Thread Michael Preslar
Found something. For class variables.. http://us.php.net/manual/en/function.property-exists.php class a { var $b; } if (property_exists('a','b')) { print yes\n; } On 8/17/07, Olav Mørkrid [EMAIL PROTECTED] wrote: the test i need should give the following results: - FALSE when $a-b

Re: [PHP] Re: isset($a-b) even if $a-b = null

2007-08-17 Thread Olav Mørkrid
yes, but that assumes you have a defined class. if $a comes from mysql_fetch_object() for instance you have just a stdobject, and this method will produce an error. On 17/08/07, Michael Preslar [EMAIL PROTECTED] wrote: Found something. For class variables..

Re: [PHP] Re: isset($a-b) even if $a-b = null

2007-08-17 Thread Olav Mørkrid
the test i need should give the following results: - FALSE when $a-b does not exist at all - TRUE when $a-b = null - TRUE when $a-b = any value empty() gives true for both $a-b = null and not setting any value, so that's no good. borokovs suggestion seems to miss the purpose. anyone else? On

Re: [PHP] Re: isset($a-b) even if $a-b = null

2007-08-17 Thread Borokov Smith
Maybe if you tell us exactly what you wish to achieve. Class variables that are not created at object creation is bad design. Olav Mørkrid schreef: yes, but that assumes you have a defined class. if $a comes from mysql_fetch_object() for instance you have just a stdobject, and this method will

Re: [PHP] Re: isset or array_key_exists?

2006-02-18 Thread Robert Cummings
On Sat, 2006-02-18 at 04:56, Rafael wrote: After a little test, although the results are not conclusive, I would say that isset(), and also that array_key_exists() may even use isset() (or similiar) internally as a first step -let's remember that isset() only does a fast search and it

Re: [PHP] Re: isset or array_key_exists?

2006-02-18 Thread Satyam
- Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Rafael [EMAIL PROTECTED] Cc: PHP-General php-general@lists.php.net Sent: Saturday, February 18, 2006 3:21 PM Subject: Re: [PHP] Re: isset or array_key_exists? On Sat, 2006-02-18 at 04:56, Rafael wrote: After a little

Re: [PHP] Re: isset or array_key_exists?

2006-02-18 Thread Rafael
Actually, it doesn't have much sense that it creates a variable (or index), though it had sense why wouldn't be so easily detected, so I printed the array after the loops and there's no new keys. I think that if that was the case, it was definitely a bug that has been corrected (PHP 4.4.0)

Re: [PHP] Re: isset or array_key_exists?

2006-02-18 Thread Robert Cummings
On Sat, 2006-02-18 at 12:39, Rafael wrote: Actually, it doesn't have much sense that it creates a variable (or index), though it had sense why wouldn't be so easily detected, so I printed the array after the loops and there's no new keys. I think that if that was the case, it was

Re: [PHP] Re: isset

2005-02-16 Thread M. Sokolewicz
Marek Kilimajer wrote: M. Sokolewicz wrote: Also note that empty($non_existent_var) will always throw an E_NOTICE error when the variable in question is not set. No, it does not. hmm... seems to have changed since I last checked (PHP5 change?) I appoligize :) -- PHP General Mailing List

Re: [PHP] Re: isset

2005-02-16 Thread Matthew Weier O'Phinney
* Bret Hughes [EMAIL PROTECTED]: I just wish there was a use strict; sort of deal so I would not have to hunt down logic errors due to mistyping a variable name. There is, in PHP5: E_STRICT. From the manual (http://php.net/manual/en/ref.errorfunc.php#errorfunc.constants): Run-time notices.

Re: [PHP] Re: isset

2005-02-16 Thread Bret Hughes
On Wed, 2005-02-16 at 07:54, Matthew Weier O'Phinney wrote: * Bret Hughes [EMAIL PROTECTED]: I just wish there was a use strict; sort of deal so I would not have to hunt down logic errors due to mistyping a variable name. There is, in PHP5: E_STRICT. From the manual

Re: [PHP] Re: isset

2005-02-16 Thread Richard Lynch
Bret Hughes wrote: On Wed, 2005-02-16 at 07:54, Matthew Weier O'Phinney wrote: * Bret Hughes [EMAIL PROTECTED]: I just wish there was a use strict; sort of deal so I would not have to hunt down logic errors due to mistyping a variable name. There is, in PHP5: E_STRICT. From the manual

Re: [PHP] Re: isset

2005-02-16 Thread Bret Hughes
On Wed, 2005-02-16 at 10:34, Richard Lynch wrote: Bret Hughes wrote: On Wed, 2005-02-16 at 07:54, Matthew Weier O'Phinney wrote: * Bret Hughes [EMAIL PROTECTED]: I just wish there was a use strict; sort of deal so I would not have to hunt down logic errors due to mistyping a variable

Re: [PHP] Re: isset

2005-02-16 Thread Bauglir
It's common mistake what you are doing... the first thing should be to test if there is such key in array: if (array_key_exists('cmd',$_POST)) { } this means to test it the variable exists, then you can test if it was set Brona Chris W. Parker wrote: M. Sokolewicz mailto:[EMAIL PROTECTED] on

RE: [PHP] Re: isset

2005-02-15 Thread Chris W. Parker
M. Sokolewicz mailto:[EMAIL PROTECTED] on Tuesday, February 15, 2005 8:25 AM said: seems lengthy. is there a way around this? i tried using $cmd = @ $_POST['cmd']; to suppress errors but didnt seem to have ay effect. still if(isset($_POST['cmd'])) { $cmd = $_POST['cmd']; }

Re: [PHP] Re: isset

2005-02-15 Thread M. Sokolewicz
Chris W. Parker wrote: M. Sokolewicz mailto:[EMAIL PROTECTED] on Tuesday, February 15, 2005 8:25 AM said: seems lengthy. is there a way around this? i tried using $cmd = @ $_POST['cmd']; to suppress errors but didnt seem to have ay effect. still if(isset($_POST['cmd'])) { $cmd =

Re: [PHP] Re: isset

2005-02-15 Thread Marek Kilimajer
M. Sokolewicz wrote: Also note that empty($non_existent_var) will always throw an E_NOTICE error when the variable in question is not set. No, it does not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: isset

2005-02-15 Thread Bret Hughes
On Tue, 2005-02-15 at 16:22, M. Sokolewicz wrote: Chris. that's a different issue. There are always at least 2 things you should do with your (expected) input: 1 - check if it *exists* (isset) 2 - check the validity (input-validation) for step #2 empty is very commonly used, and also a

RE: [PHP] Re: IsSet() and $_SESSION

2003-06-30 Thread Ford, Mike [LSS]
-Original Message- From: John Manko [mailto:[EMAIL PROTECTED] Sent: 30 June 2003 15:14 To: [EMAIL PROTECTED] Subject: [PHP] Re: IsSet() and $_SESSION None of these worked for me. ok, if you look at the code, the part where echo $_SESSION['uid']; is actually works. I get

RE: [PHP] Re: isset

2002-07-09 Thread Preston Wade
5:35 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: isset i think what you're trying to do is ?php if($REQUEST_METHOD == POST) { echo Form has been submitted.; exit; } else { echo Display the form that has to be submitted.': exit; } ? Preston Wade [EMAIL

Re: [PHP] Re: isset

2002-07-09 Thread vins
ubmitted!; } ? form action=?=$PHP_SELF ? method=post blah, blah input type=submit name=submit value=Submit /form -Original Message- From: vins [EMAIL PROTECTED]@INTERNET@HHC Sent: Tuesday, July 09, 2002 5:35 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: isset i think what you'r

Re: [PHP] if(isset($submit))

2002-02-28 Thread Simon Willison
jtjohnston wrote: I can't get this to work: if(isset($submit)) with: input type=\image\ name=\submit\ value=\submit\ src=\nextgif\ border=\0\ align=\ABSCENTER\ I'm not coding correctly? If you are testing for $submit a work around is to have a hidden field in your form that looks like

Re: [PHP] if(isset($submit))

2002-02-28 Thread Adrian Murphy
just use an input type=hidden and call it submit,thats what i do - Original Message - From: jtjohnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 28, 2002 5:32 AM Subject: Re: [PHP] if(isset($submit)) So I can forget using type=image :( Wah, it's not fair

RE: [PHP] if(isset($submit))

2002-02-27 Thread Martin Towell
I used this code form action=/inetpub/wwwroot/top.html method=get input type=image src=none.gif width=125 height=25 name=submit value=submit /form when I clicked on the image, I got this url file:///C:/inetpub/wwwroot/top.html?submit.x=118submit.y=20 so php would get this as $submit_x and

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
I s'pose, but where/why are you getting submit.x=118submit.y=20 Martin Towell wrote: I used this code form action=/inetpub/wwwroot/top.html method=get input type=image src=none.gif width=125 height=25 name=submit value=submit /form when I clicked on the image, I got this url

RE: [PHP] if(isset($submit))

2002-02-27 Thread Martin Towell
it's a browser thing, i guess, when you use an image as a submit button Martin -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:28 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if(isset($submit)) I s'pose, but where/why are you getting

Re: [PHP] if(isset($submit))

2002-02-27 Thread Richard Baskett
] Organization: FLSH, Université de Sherbrooke Reply-To: [EMAIL PROTECTED] Date: Thu, 28 Feb 2002 00:28:09 -0500 To: [EMAIL PROTECTED] Subject: Re: [PHP] if(isset($submit)) I s'pose, but where/why are you getting submit.x=118submit.y=20 Martin Towell wrote: I used this code form action

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
Nope, not following. :) More particularily why will isset accept type=submit and not type=image ? Martin Towell wrote: I used this code form action=/inetpub/wwwroot/top.html method=get input type=image src=none.gif width=125 height=25 name=submit value=submit /form when I clicked on the

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
So I can forget using type=image :( Wah, it's not fair! :) J Martin Towell wrote: I used this code form action=/inetpub/wwwroot/top.html method=get input type=image src=none.gif width=125 height=25 name=submit value=submit /form when I clicked on the image, I got this url

RE: [PHP] if(isset($submit))

2002-02-27 Thread Martin Towell
or have a hidden field, maybe, called submit -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if(isset($submit)) So I can forget using type=image :( Wah, it's not fair! :) J

Re: [PHP] if(isset($submit))

2002-02-27 Thread Richard Baskett
PROTECTED] Subject: Re: [PHP] if(isset($submit)) Nope, not following. :) More particularily why will isset accept type=submit and not type=image ? Martin Towell wrote: I used this code form action=/inetpub/wwwroot/top.html method=get input type=image src=none.gif width=125 height=25 name

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
Over kill? Martin Towell wrote: or have a hidden field, maybe, called submit -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if(isset($submit)) So I can forget using type

Re: [PHP] Re: !isset ??

2002-02-06 Thread Erik Price
On Wednesday, February 6, 2002, at 03:28 PM, CC Zona wrote: PHP's loose typing means that !$somevar evalutes as true if the variable is null, if it has an (integer, float, or string) value of zero, if it's an empty string, or if it is set to boolean false. Or if the variable/index does

Re: [PHP] if(isset($a)) vs if($a)

2001-09-16 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Mark) wrote: if(isset($) and !empty($a) and !$a) this is the same as if(!empty($a)) or if(isset($) and $a===FALSE) this is the same as if(empty($a)) (Aside from accidentally omitted the a in the var name...oops...) No, they're not

Re: [PHP] if(isset($a)) vs if($a)

2001-09-16 Thread Mark
On Sun, 16 Sep 2001 09:18:23 -0700, CC Zona wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Mark) wrote: if(isset($) and !empty($a) and !$a) this is the same as if(!empty($a)) or if(isset($) and $a===FALSE) this is the same as if(empty($a)) Aside from accidentally omitted the

Re: [PHP] if(isset($a)) vs if($a)

2001-09-16 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Mark) wrote: calling empty($a) does not give a warning. Sheesh. It doesn't at that. WTF? -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [PHP] if(isset($a)) vs if($a)

2001-09-15 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Andrew Perevodchik) wrote: JD isset checks to see if the $a variable has JD been set, ie, if it exists. if($a) checks for JD the truthood of $a, meaning, if it has a JD non-zero, non-null/empty-string value, then JD its true, else, false.

Re: [PHP] if(isset($a)) vs if($a)

2001-09-15 Thread Mark
On Sat, 15 Sep 2001 13:20:59 -0700, CC Zona wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Andrew Perevodchik) wrote: JD isset checks to see if the $a variable has JD been set, ie, if it exists. if($a) checks for JD the truthood of $a, meaning, if it has a JD non-zero,

RE: [PHP] if(isset($a)) vs if($a)

2001-09-14 Thread Jack Dempsey
isset checks to see if the $a variable has been set, ie, if it exists. if($a) checks for the truthood of $a, meaning, if it has a non-zero, non-null/empty-string value, then its true, else, false. jack -Original Message- From: David Yee [mailto:[EMAIL PROTECTED]] Sent: Friday, September

RE: [PHP] weird isset problem

2001-03-29 Thread Johnson, Kirk
I see one typo, is that the problem? Kirk Hi! I have this weird thing happening here and I just can't see the problem. Can someone look at this and tell me if you see what is wrong? Code print isset($config["harvester_list"]) ."\n1\n"; print

Re: [PHP] weird isset problem

2001-03-29 Thread Philip Olson
What are you wanting to print? Here's a set of examples that may help understand what's happening with your code. In short, isset() is not being used properly. // if $var is set, this will return 1. if not set then it will return 0. // essentially, you don't want to print this directly as

RE: [PHP] Not isset

2001-03-09 Thread Boget, Chris
how do I write a Not isset as in: if != isset($order) { $order=$Table."ID"; } if( !( isset( $order ))) { } I'm big on parens. :p OR if( empty( $order )) { } Chris

RE: [PHP] Not isset

2001-03-09 Thread Brian Paulson
try if(!(isset($order))) { $order=$Table."ID"; } hth Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Mike [mailto:[EMAIL PROTECTED]] Sent: Friday, March 09, 2001 1:34 PM To: [EMAIL