* 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=1edit
or given the following
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 wrote
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
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 should not run. However,
if the $senderEmailAddress variable is not set, the
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 :
... 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 != ) {
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 should not run.
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
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, please
I'm having a problem with the value that isset returns on $_SESSION
variables. For some reason, even if $_SESSION['uid'] is set, isset
returns FALSE. Here is the code:
-- file1.php ---
include file2.php;
if (!isset($_SESSION[uid])) {
// This first time $_SESSION[uid] is
Having a bit of trouble with my forms returnin 1 in the form fields accept the data
that was entered. I think its because of this line,
$output_fname = isset($HTTP_POST_VARS['fname']);
I have a command action handler also that works in the same script and it seems to
work well, the only
PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, June 14, 2003 4:54 PM
Subject: [PHP] isset()
Having a bit of trouble with my forms returnin 1 in the form fields accept
the data that was entered. I think its because of this line,
$output_fname = isset($HTTP_POST_VARS['fname']);
I have a command
:54 PM
Subject: [PHP] isset()
Having a bit of trouble with my forms returnin 1 in the form fields accept
the data that was entered. I think its because of this line,
$output_fname = isset($HTTP_POST_VARS['fname']);
I have a command action handler also that works in the same script
Is isset() better than $ != ?
Often, I may have a 0 as values. While $ != doesn't recognize 0s (as in, that if
would be false), isset() seems to work. Should I change all my $ != to isset()s, or
are there other factors I should check?
Responding to myself:
Is isset() better than $ != ?
Often, I may have a 0 as values. While $ != doesn't recognize 0s (as in,
that if would be false), isset() seems to work. Should I change all my $ !=
to isset()s, or are there other factors I should check?
Conversely, what about empty(). Is
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
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
However, when I
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
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 a
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:
Just use empty() ?!
With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !
use isset() first and then check wheter empty or not empty!
so there is not one function that tests for empty and isset same time!?
Elias
Analysis Solutions [EMAIL
.
- Original Message -
From: lallous
Sent: 2002Äê8ÔÂ3ÈÕ 15:01
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var) !empty($var) same time!
Just use empty() ?!
With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !
use isset() first and then check
ÈÕ 15:01
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var) !empty($var) same time!
Just use empty() ?!
With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !
use isset() first and then check wheter empty or not empty!
so there is not one
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($var) same time!
because your variable
I have wrote this function:
function issne($var)
{
return isset($var) !empty($var) ? true : false;
}
which can be called as: if (issne($mightbeundefinedvariable)) echo using
this variable;
is there is any builtin function that does that? (one function call).
//Elias
--
PHP General
On Fri, Aug 02, 2002 at 04:48:17PM +0200, lallous wrote:
function issne($var)
{
return isset($var) !empty($var) ? true : false;
}
is there is any builtin function that does that? (one function call).
Yes. Just use empty(). It automatically checks if the variable is:
not set
But if this is true what you say, that empty() checks for
not set
null
an empty string
zero
Why would i ever want to use isset() then?
If i understood you correctly, would the following
op = isset($_GET['op']) !empty($_GET['op']) ? $_GET['op'] : '';
be the same as
op =
Folks:
On Fri, Aug 02, 2002 at 07:01:38PM +0200, Jürgen wrote:
Why would i ever want to use isset() then?
Because sometimes you just want to check if something is set due to null,
'' and 0 being important.
$var = '';
empty($var); // evaluates to true
isset($var); // evaluates to
Hello All,
I am trying to use the isset function to test if the page has been
submitted, but it seems as though it is not working. I am wondering is
there a configuration option that is messing with the functionality of
isset.
Any help would be appreciated.
Thanks,
Preston Wade
--
PHP
register_globals on or off?
On Tue, 9 Jul 2002, Preston Wade wrote:
Hello All,
I am trying to use the isset function to test if the page has been
submitted, but it seems as though it is not working. I am wondering is
there a configuration option that is messing with the functionality of
that seem always to be the prob with any php coding now days
globals on or off
Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
register_globals on or off?
On Tue, 9 Jul 2002, Preston Wade wrote:
Hello All,
I am trying to use the isset
Yup
On Wed, 10 Jul 2002, vins wrote:
that seem always to be the prob with any php coding now days
globals on or off
Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
register_globals on or off?
On Tue, 9 Jul 2002, Preston Wade wrote:
what is it you are testing for?
a page that has been submitted. do you mean from an html form or some other
method?
Jim Lucas
- Original Message -
From: Preston Wade [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 3:20 PM
Subject: [PHP] isset
Hello All,
I am
HTML form. register_globals is off.
Thanks,
Preston
-Original Message-
From: Jim lucas [EMAIL PROTECTED]@INTERNET@HHC
Sent: Tuesday, July 09, 2002 5:29 PM
To: Preston Wade; [EMAIL PROTECTED]
Subject: Re: [PHP] isset
...
what is it you are testing for?
a page
..
extract($_POST);
if (isset($submit)) {}
Hope this gets you started. Read up on the manual. http://www.php.net. :)
-Kevin
- Original Message -
From: Preston Wade [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 4:20 PM
Subject: [PHP] isset
Hello All,
I am trying
Look at that we get an easy question and 50 people reply. Today has just
been our day for spam. *LOL* :)
-Kevin
- Original Message -
From: Kevin Stone [EMAIL PROTECTED]
To: Preston Wade [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 4:37 PM
Subject: Re: [PHP] isset
This is what I was looking for.
Thanks!
Preston
-Original Message-
From: Kevin Stone [EMAIL PROTECTED]@INTERNET@HHC
Sent: Tuesday, July 09, 2002 5:37 PM
To: Preston Wade; [EMAIL PROTECTED]
Subject: Re: [PHP] isset
...
form method=post
input type=submit name=submit
Message -
From: Kevin Stone [EMAIL PROTECTED]
To: Preston Wade [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 4:37 PM
Subject: Re: [PHP] isset
form method=post
input type=submit name=submit
/form
if (isset($_POST['submit'])){}
// or //
if (isset($HTTP_POST_VARS
Me too ;)
-Original Message-
i agree to that
Look at that we get an easy question and 50 people reply. Today has just
been our day for spam. *LOL* :)
This message is intended for the sole use of the
So what is the good of isset? What does if(isset($submit)) do
differently than if($submit) ??
J
--
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp
PROTECTED]]
Sent: 28. helmikuuta 2002 7:34
To: [EMAIL PROTECTED]
Subject: [PHP] isset?
So what is the good of isset? What does if(isset($submit)) do
differently than if($submit) ??
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP
Hm. I hope I'm not opening an old wound:
Curious about the proper way to test for the existence of a variable, I
decided to read up on isset() at php.net's function manual pages. It
seems at first to be a way to test whether or not a variable has been
set.
But reading the annotations below
At 03:06 PM 2/6/2002 -0500, Erik Price wrote:
Pretty confusing. Can anyone shed some light on whether or not there is a
final definite way to do this? I've used (!($_POST['var'])) with no
problems in the past, but does good coding style suggest that I use
(!isset($_POST['var'])) now?
The
On Wednesday, February 6, 2002, at 03:42 PM, Michael Sims wrote:
This is fine for most cases, but let's say that $_POST['var'] *is* set
to either an empty string () or a string containing zero (0). Your
test will fail, because both of these are evaluated as FALSE when cast
as a
Hi ,
Is there anyway of hiding the name of the website in the isset Enter
Network Password window?
if (isset( $PHP_AUTH_USER ) isset($PHP_AUTH_PW))
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Hi!
isset() fails :(
i peeferd using it so as not to use session_start() when the guy is not
logged !
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
--
PHP General Mailing List
need a little more data. how is it failing ? where in what code ? how are
you using it ? in what way do you want it to work ?
http://php.net/manual/en/function.isset.php
--
Chris Lee
[EMAIL PROTECTED]
kaab kaoutar [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL
Hi!
Is there any difference between writing:
isset($my_var)
and...
if ($my_var)
??
Thanks!
/ Jesper Blomstroem
--
Jesper Blomstrm
[EMAIL PROTECTED]
Arbete: 08-566 280 08
Hem:08-669 23 10
Mobil: 070-30 24 911
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
age -
From: "Jesper Blomstrm" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 09, 2001 1:56 PM
Subject: [PHP] isset() VS if($var)
Hi!
Is there any difference between writing:
isset($my_var)
and...
if ($my_var)
??
Thanks!
/ Jesper Blomstroem
--
Jesper Bloms
, 2001 9:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] isset() VS if($var)
Hi!
Is there any difference between writing:
isset($my_var)
and...
if ($my_var)
??
Thanks!
/ Jesper Blomstroem
--
Jesper Blomstrm
[EMAIL PROTECTED]
Arbete: 08-566 280 08
Hem:08-669 23 10
Mobil: 070-30 24 911
der, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-Original Message-
From: Jesper Blomstrm [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 9:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] isset() VS if($var)
Hi!
Is there any
on 10.03.2001 10:10 Uhr, Alexander Lohse at [EMAIL PROTECTED] wrote:
Hi,
is it a fact that: If I have multiple select with e.g. "pers[]" as
name, I cannot check for an isset($pers) if the user left the field
blank?
I know it all works with textfields ... But in this case isset()
seems
Hi,
is it a fact that: If I have multiple select with e.g. "pers[]" as
name, I cannot check for an isset($pers) if the user left the field
blank?
I know it all works with textfields ... But in this case isset()
seems not work. There is also no entry in HTTP_POST_VARS for that.
Or might this
Wow, I hope you all will forgive me for one last go around on this thread :)
Technically, what does "set" mean? It is not the same as "is registered" or
"has a value", right? What is "is set"? Is it "introduced to the global
namespace"?
TIA
Kirk
Except that it will throw a warning in PHP4 if
On Monday 26 February 2001 18:07, Johnson, Kirk wrote:
Wow, I hope you all will forgive me for one last go around on this
thread :)
Technically, what does "set" mean? It is not the same as "is
registered" or "has a value", right? What is "is set"? Is it
"introduced to the global namespace"?
you do not want to use strlen() for the following reasons:
1) makes code unreadable - very sloppy
Yeah and your if(isset($var) $var != '') is pretty
2) overhead
You call one function and do two comparisons - vs an age old C function
I'd like to run some numbers on that.
3) it will
: Sunday, February 25, 2001 5:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()
On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger
([EMAIL PROTECTED]) wrote:
On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
in my preceding email I've written:
if($var
On 25 Feb 2001 00:01:30 -0800, Mark Maggelet [EMAIL PROTECTED] wrote:
On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger
([EMAIL PROTECTED]) wrote:
On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
in my preceding email I've written:
if($var!='')
will fix your all your worries
empty() fails when $var == 0
--Joe
On Sun, Feb 25, 2001 at 10:50:15AM -0800, Chris Adams wrote:
On 25 Feb 2001 00:01:30 -0800, Mark Maggelet [EMAIL PROTECTED] wrote:
On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger
([EMAIL PROTECTED]) wrote:
On Saturday 24 February 2001 17:18,
: [PHP] isset()
You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need to
remember that mostly idiots are inputting the data :O)
--Joe
On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBe
-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:09 AM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()
For the last time - put an input box on a page and submit with NOTHING in
the
box. Now I want SOMETHING in that box (like a name) - isset
On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
in my preceding email I've written:
if($var!='')
will fix your all your worries without an intervention of a strings
function.
Except that it will throw a warning in PHP4 if $var is not set.
= isset () should be used.
--
On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger
([EMAIL PROTECTED]) wrote:
On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
in my preceding email I've written:
if($var!='')
will fix your all your worries without an intervention of a
strings
function.
Except that it will
Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:07 AM
To: Steve Edberg
Cc: Jacky@lilst; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()
I stand firm on strlen() for the following reasons ...
if(!$var) will sometimes act strangely (has for me in the past) when
variabl
www.phpbeginner.com
-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:07 AM
To: Steve Edberg
Cc: Jacky@lilst; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()
I stand firm on strlen() for the following reasons ...
if(!$var
: Re: [PHP] isset()
You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need to
remember that mostly idiots are inputting the data :O)
--Joe
On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner
:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:25 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()
You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need t
People
I tried to check if teh field has set a vaule in it before submit using isset with the
sniplet below
if ((isset($AgeChild))=="false") {
$AgeChild = "NA";
}
The resule is that it always displays NA whether or not it has vaule in the field,
what is the correct way of using isset for this
[PHP] isset()yes, it is the var from the form
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"
- Original Message -
From: Thiva Charanasri
To: 'Jacky@lilst'
Sent: Thursday, February 22, 2001 3:59 AM
Subject: [
People
I tried to check if teh field has set a vaule in it before submit using isset with
the sniplet below
if ((isset($AgeChild))=="false") {
$AgeChild = "NA";
}
if you removed the quotes around "false" it should work (as currently
"false" is being treated as a string) but another way
8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] isset()
People
I tried to check if teh field has set a vaule in it before submit using
isset with the sniplet below
if ((isset($AgeChild))=="false") {
$AgeChild = "NA";
}
The resule is that it always displays NA whether
I stand firm on strlen() for the following reasons ...
if(!$var) will sometimes act strangely (has for me in the past) when variables
are set to something other than what you are expecting.
if(isset($var)) will return true if your text field is declared but not filled
in.
if(empty($var)) will
At 19:07 22.02.2001, Joe Stump said:
[snip]
I'll take an extra bazillionth of a second to know for sure
I have what I need
[snip]
Do you really know _how_ right you are?
g
...ebird
O Ernest E.
it is possible to use isset inside a echo?
like this:
$checked = "CHECKED";
$nothing = "";
echo "input type=checkbox name=cb[0] value=$value[0]
".isset(cb[0])?$checked:$nothing."";
Rom
On Thu, 18 Jan 2001, Romulo Roberto Pereira wrote:
it is possible to use isset inside a echo?
like this:
$checked = "CHECKED";
$nothing = "";
echo "input type=checkbox name=cb[0] value=$value[0]
".isset(cb[0])?$checked:$nothing."";
Rom
isset() is a proper function, so yes.
--
101 - 175 of 175 matches
Mail list logo