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
I'm using
if($mydata-DPRresponselocationaddress1 != )
is this the same as
if (!isset($mydata-DPRresponselocationaddress))
http://php.net/manual/en/function.isset.php
or
if (!empty($mydata-DPRresponselocationaddress))
http://php.net/manual/en/function.empty.php
or is there another function I
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 field data using the
$_REQUEST[] function.
I have a small if
On Mon, Aug 3, 2009 at 1:08 PM, Allen McCabeallenmcc...@gmail.com 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
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 allenmcc...@gmail.com wrote in message
On Mon, 03 Aug 2009 20:11:44 +0300, Parham Doustdar parha...@gmail.com
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
Thanks!
On Mon, Aug 3, 2009 at 10:13 AM, Andrew Ballard aball...@gmail.com wrote:
On Mon, Aug 3, 2009 at 1:08 PM, Allen McCabeallenmcc...@gmail.com
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
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 not a
: php-general@lists.php.net
Subject: [PHP] isset not functioning
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
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
to use both:
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 pa...@quillandmouse.com wrote in message
news:20090621032151.gb14...@quillandmouse.com...
On Sat, Jun 20, 2009 at 12:20:56PM +0100, Ashley Sheridan wrote:
On Sat,
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 pa...@quillandmouse.com wrote in message
news:20090621032151.gb14...@quillandmouse.com...
On Sat, Jun 20,
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 for PHP
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
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 waynn...@gmail.com wrote in message
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:
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 : ;
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']) and
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 Notice
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 mortgage amount is
What am I
2009/6/18 Gary gwp...@ptd.net:
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
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
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
I notice that you're checking $_POST['mort'] but you're echoing $mort,
is that your actual code?
On 6/18/09, Gary gwp...@ptd.net 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.
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: gwp...@ptd.net
CC: php-general@lists.php.net
Subject: Re: [PHP] isset question
2009/6/18 Gary gwp...@ptd.net:
I have a form that gives the submitter
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 objects.
hope someone can
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
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_exists() seems
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.edu/resetpw.php
[Wed May 09 08:59:05 2007] [error] [client
-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.225.246
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:
# [EMAIL PROTECTED] / 2007-04-17 13:59:39 +0200:
snip
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.
/snip
Hi nothing to do with the actual topic, i am
snip
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.
/snip
Hi nothing to do with the actual topic, i am just wondering how you get this
internals information
Tim wrote:
snip
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.
/snip
Hi nothing to do with the actual topic, i am just wondering how you get this
internals
On Tue, 2007-04-17 at 13:14 +0100, Stut wrote:
Tim wrote:
snip
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.
/snip
Hi nothing to do with the actual
On Tue, April 17, 2007 6:59 am, Tim wrote:
snip
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.
/snip
Hi nothing to do with the actual topic, i am just wondering
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 as empty()
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
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 (
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 (
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.
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
I
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
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'] =
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:
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
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'] =
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:
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
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.
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 (isset($_REQUEST['var'])) {
}
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
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 containing a
0 are
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
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.
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.
It just
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
-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:
On Apr 16, 2007, at 12:30 PM, Robert Cummings wrote
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
Use
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, and
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 warning
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.
'empty'
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:
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.
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 element
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 thinks is set
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 thinks is set
php -r '
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?
how I
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset
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
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
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 = );
Please, answer:
what construction works faster:
if ( isset ( $result [$i] [key] ) )
{do something; }
or
if ( array_key_exists ( key, $result [$i] ) )
{do something; }
?
Nikolay
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?
i tried using
$cmd = @
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?
i tried
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?
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
--
PHP General
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'm sure
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:
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
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
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 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
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
If you use ISSET together with a hidden field when posting a form to itself
to enter a second-state, is there a way of using it again to get to a
third-state.
Basically, I'm trying to convert a 3 file script into a single file and
first I check to see if it's been submitted and then using ELSE I
[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
[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
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 wondering if there's
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... how does if ($variable) work? When does it evaluate true?
--
Marcjon
--
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 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
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 another
Hello Jason,
Sunday, February 15, 2004, 7:44:06 PM, you 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
JW What is horrible about that style?
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 all
On Monday 16 February 2004 18:14, Richard Davey wrote:
Consistency.
With what? With whose idea of style/formatting?
I doubt you will find consistency in the real between different
programmers/organisations. If such consistency was there then PHP would've
have only had to support a single
Hello Jason,
Monday, February 16, 2004, 2:21:01 PM, you wrote:
Consistency.
JW With what? With whose idea of style/formatting?
If you hadn't chopped off the rest of my paragraph you'd have the
answer.
JW I doubt you will find consistency in the real between different
JW
The following script is from Kevin Yank's book (Sitepoint).
When I test it _without_ entering a name in the text box and hit submit, the
_next_ page
loads - however the same page should load beacuse of the conditional
if (!isset($name) ):
.
If I replace
!isset()
with
empty()
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 to
- 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
teaching
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
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 form element:
input type=hidden name=edit
My blah.php script
1 - 100 of 175 matches
Mail list logo