473,387 Members | 1,295 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Confusing POST behavior -- doing it twice?

(posted previously on comp.lang.php but no response received. Cross-posted
in the dreamweaver forum)

I am confused about what goes on with method POST. Here is an overview of a
my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
---Do a bunch of stuff---
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (strcmp($A, "any") {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php:);
}
}
}
header("Location: anotherSite.php:);
?>

...... in the form description I have an
<?php if (isset(($_SESSION['Error'])) echo $_SESSION['Error']; ?>
(Note: The form is type POST).

So here is the problem:
1 - When I start, there is no error message.
2 - I deliberately put in a bad zip code and have a value other than "any"
in the A control and click to submit it.
3 - Instead of going back to thisSite.php and displaying the error message,
it goes to anotherSite.php.
4 - If I then hit the back arrow on the browser, it displays with the error
message on thisSite.php

It seems that
1 - on the submit it goes through the logic and sets the error.
2 - It then must be going through a second time, but this time taking on the
default setting of "any" for control A and so bypass the logic on the zip
code and so goes to anotherSite.php.

Please help me here.

Shelly
Aug 1 '05 #1
16 2042
Hi Shelly,

Please include an else:

// Verify that a Zip code is numeric and is five digits

if (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php");
}else {
header("Location: anotherSite.php");
}

Let me know how you do.

Cheers,

DXTrim

"Shelly" <sh************@asap-consult.com> wrote in message
news:kH******************@twister.nyroc.rr.com...
(posted previously on comp.lang.php but no response received. Cross-posted in the dreamweaver forum)

I am confused about what goes on with method POST. Here is an overview of a my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
---Do a bunch of stuff---
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (strcmp($A, "any") {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php:);
}
}
}
header("Location: anotherSite.php:);
?>

..... in the form description I have an
<?php if (isset(($_SESSION['Error'])) echo $_SESSION['Error']; ?>
(Note: The form is type POST).

So here is the problem:
1 - When I start, there is no error message.
2 - I deliberately put in a bad zip code and have a value other than "any"
in the A control and click to submit it.
3 - Instead of going back to thisSite.php and displaying the error message, it goes to anotherSite.php.
4 - If I then hit the back arrow on the browser, it displays with the error message on thisSite.php

It seems that
1 - on the submit it goes through the logic and sets the error.
2 - It then must be going through a second time, but this time taking on the default setting of "any" for control A and so bypass the logic on the zip
code and so goes to anotherSite.php.

Please help me here.

Shelly

Aug 1 '05 #2
Shelly wrote:
(posted previously on comp.lang.php but no response received.
Cross-posted in the dreamweaver forum)

I am confused about what goes on with method POST. Here is an overview of
a my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
---Do a bunch of stuff---
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (strcmp($A, "any") {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {


Hi,

Shouldn't this be:
$_POST["zip"] instead of $_POST[$zip] ??

Are you expecting a posted name/value with 'zip' as name?

$_POST[$zip] will try to fetch WHATEVER $zip will be, probably nothing.

Regards,
Erwin Moller
Aug 1 '05 #3

"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:42***********************@news.xs4all.nl...
Shelly wrote:
(posted previously on comp.lang.php but no response received.
Cross-posted in the dreamweaver forum)

I am confused about what goes on with method POST. Here is an overview
of
a my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
---Do a bunch of stuff---
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (strcmp($A, "any") {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST'['zip']) strlen($_POST['zip']) != 5) then
{


Hi,

Shouldn't this be:
$_POST["zip"] instead of $_POST[$zip] ??


Yes, it is 'zip' and, yes, there is a "zip" control. I just typed wrong in
entering it here. I corrected it above and further corrected my typing of
this post to "[" instead of "(".

Shelly

Aug 1 '05 #4
Here is the corrected post. I made about 5 errors in typing this post the
first time that are not in the actual (full) code.

I am confused about what goes on with method POST. Here is an overview of a
my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
if (isset($_SESSION['Error'])) {
unset($_SESSION['Error']);
}
if (strcmp($A, "any")) {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST['zip']) || strlen($_POST['zip']) != 5) then
{
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php");
}
}
}
header("Location: anotherSite.php");
?>

...... in the form description I have an
<?php if (isset(($_SESSION['Error'])) echo $_SESSION['Error']; ?>

(Note: The form is type POST).

So here is the problem:
1 - When I start, there is no error message.
2 - I deliberately put in a bad zip code and have a value other than "any"
in the A control and click to submit it.
3 - Instead of going back to thisSite.php and displaying the error message,
it goes to anotherSite.php.
4 - If I then hit the back arrow on the browser, it displays with the error
message on thisSite.php

It seems that
1 - on the submit it goes through the logic and sets the error.
2 - It then must be going through a second time, but this time taking on the
default setting of "any" for control A and so bypass the logic on the zip
code and so goes to anotherSite.php.

Please help me here.

Shelly
Aug 1 '05 #5
JDS
On Mon, 01 Aug 2005 13:44:48 +0000, Shelly wrote:
(posted previously on comp.lang.php but no response received. Cross-posted
in the dreamweaver forum)

I am confused about what goes on with method POST. Here is an overview of a
my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
---Do a bunch of stuff---
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (strcmp($A, "any") {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php:);
}
}
}
header("Location: anotherSite.php:);
?>

..... in the form description I have an
<?php if (isset(($_SESSION['Error'])) echo $_SESSION['Error']; ?>
(Note: The form is type POST).

So here is the problem:
1 - When I start, there is no error message.
2 - I deliberately put in a bad zip code and have a value other than "any"
in the A control and click to submit it.
3 - Instead of going back to thisSite.php and displaying the error message,
it goes to anotherSite.php.
4 - If I then hit the back arrow on the browser, it displays with the error
message on thisSite.php

It seems that
1 - on the submit it goes through the logic and sets the error.
2 - It then must be going through a second time, but this time taking on the
default setting of "any" for control A and so bypass the logic on the zip
code and so goes to anotherSite.php.

Please help me here.

Shelly


There are several things that I am not crazy about in your code. And your
usenet post

0) looks like you have MULTI-posted, not CROSS-posted. There is an
important distinction.

1) you may want to consider using "and" instead of "&&". See:
http://www.php.net/manual/en/languag...ors.precedence
(minor issue)

2) Why use strcmp() when == will do? In any case, according to your step
number (2) what you do will not trigger true in "if (strcmp($A, "any") {"
so it will just skip all that stuff and drop out to the final Location
header -- anotherSite.php

3) "When I start, there is no error message" -- when you start what? You
mean, "$_SESSION['Error'] is unset before any of this stuff happens? What
is the error message that appears when you "If I then hit the back arrow
on the browser, it displays with the error"?

4) Your syntax is goofy on a couple of the if() statements.

if (isset($_SESSION['Error'])) unset($_SESSION['Error']);

Why is that whole thing in parens? Is the last paren just before the
semicolon a typo?

If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {

How about this one? It *looks* like it has a typo. I can't tell. It looks
like it is missing an "and" or "or" (or && or ||). Are you cutting and
pasting *actual* code into your Usenet post or is this hand typed?

5) The $_SESSION stuff will only show up on sites within the same base
URL. Are "thisSite.php" and "anotherSite.php" on the same server?

6) You are supposed to use absolute URLs when doing a
"header('Location:...')" redirection. Most browsers and servers and PHP
itself are flexible in this regard, but the "official" requirement is the
full URI including "http://".

7) You really should also include "exit;" as the very next line after any
header("Location:..."); -- unexpected results occur otherwise (I learned
the hard way).

8) A cleaner and simpler way (for me) to match five numeric digits is with
regular expressions -- e.g. preg_match(). With PHP's loose data typing, a
numeric thing might actually be a string. In any case, here is how:

preg_match("/\d\d\d\d\d/", $zip);

or

preg_match("/\d{5}/", $zip);

9) One last thing: It would be helpful to see your HTML form as well.
later...

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Aug 1 '05 #6
"JDS" <je*****@example.invalid> wrote in message
news:pa***************************@example.invalid ...
There are several things that I am not crazy about in your code. And your
usenet post

0) looks like you have MULTI-posted, not CROSS-posted. There is an
important distinction.
Please explain. I merely wanted to be polite and say that I had also posted
it in another forum.

1) you may want to consider using "and" instead of "&&". See:
http://www.php.net/manual/en/languag...ors.precedence
(minor issue)
I'll look at it. I am so used to C and Java coding (new to the web coding
and PHP) that I used the ones I knew.

2) Why use strcmp() when == will do? In any case, according to your step
Force of habit (and it would be !=, not ==).. I use strcmp because of past
programming experience. To compare strings you use strcmp (or an
equivalent). An "==" compares the addresses of the two items and not the
values of the two items, since strings are arrays in these other languages.
number (2) what you do will not trigger true in "if (strcmp($A, "any") {"
so it will just skip all that stuff and drop out to the final Location
header -- anotherSite.php
The strcmp is correct. If $A is NOT equal to "any", then strcmp returns
other than zero and the code IS perfermed. That is what I want to happen.
3) "When I start, there is no error message" -- when you start what? You
mean, "$_SESSION['Error'] is unset before any of this stuff happens? What
Yes.
is the error message that appears when you "If I then hit the back arrow
on the browser, it displays with the error"?
The value that I set it to when the condition of a bad zip code is met.
4) Your syntax is goofy on a couple of the if() statements.

if (isset($_SESSION['Error'])) unset($_SESSION['Error']);

Why is that whole thing in parens? Is the last paren just before the
semicolon a typo?
It isn't all in parens, and it isn't a typo. Look again. The first left
paren opens the if. The second left paren opens the isset. These are both
closed before the unset. The next left paren opens the unset and the right
paren before the semicolon closes it. The syntax is correct.

If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) then {

How about this one? It *looks* like it has a typo. I can't tell. It looks
It is a type (along with MANY others that typed in wrong -- but are correct
in the code). I submitted corrected code in a later post.
like it is missing an "and" or "or" (or && or ||). Are you cutting and
pasting *actual* code into your Usenet post or is this hand typed?
By hand -- BIG mistake on my part. I won't do that again.
5) The $_SESSION stuff will only show up on sites within the same base
URL. Are "thisSite.php" and "anotherSite.php" on the same server?
Yes.
6) You are supposed to use absolute URLs when doing a
"header('Location:...')" redirection. Most browsers and servers and PHP
itself are flexible in this regard, but the "official" requirement is the
full URI including "http://".
Mine works with relative URLs.
7) You really should also include "exit;" as the very next line after any
header("Location:..."); -- unexpected results occur otherwise (I learned
the hard way).
That is how I actually just solved this problem. I was about to post that
message (that I solved my problem) when I read your post first. It works
now, but I don't understand why.

8) A cleaner and simpler way (for me) to match five numeric digits is with
regular expressions -- e.g. preg_match(). With PHP's loose data typing, a
numeric thing might actually be a string. In any case, here is how:

preg_match("/\d\d\d\d\d/", $zip);

or

preg_match("/\d{5}/", $zip);
Thanks. I'll implement that. However, I don't think I care here whether it
is a string or a number. Actually EVERY input from the screen as user input
is a string. I know that in Java you must convert all of these to numbers
with the appropriate parse_ method. Is there a pressing reason not to do it
the way I did?
9) One last thing: It would be helpful to see your HTML form as well.


I realize that now. I should have said that A is a control that is a list
box. One of the values is "any". I amd doing a distance match and if the
choice is "any" I don't care what the user's zip code is. I only care when
a distance is specified in the list box. (that is why the strcmp logic). I
also should have said that "zip" is the control for the zip code.

Thank you for your time and suggestions.

Shelly
Aug 1 '05 #7
Shelly wrote:

Hi Shelly,

I added a few things that may help.
Being in a hurry (food at home :P), I am not able to look into it in greater
depth.

Here is the corrected post. I made about 5 errors in typing this post the
first time that are not in the actual (full) code.

I am confused about what goes on with method POST. Here is an overview of
a my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
if (isset($_SESSION['Error'])) {
unset($_SESSION['Error']);
}
Just a remark: Why do you not always unset the error?
Or is this code in a more complex environment where you want to be able too
keep the custum-errormessage around?
(Not important, just curious)

if (strcmp($A, "any")) {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST['zip']) || strlen($_POST['zip']) != 5) then
{
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php");
Add
exit 0;

The header you set will just do that: set the header.
The program will run on from there.
Later on you will be able to give it another value (which you actually do).
So you have to force PHP to quit here.

}
}
}
header("Location: anotherSite.php");
Here you overwrite your previously set header. :-/

?>

..... in the form description I have an
<?php if (isset(($_SESSION['Error'])) echo $_SESSION['Error']; ?>

(Note: The form is type POST).

So here is the problem:
1 - When I start, there is no error message.
good.
2 - I deliberately put in a bad zip code and have a value other than "any"
in the A control and click to submit it.
Ok, and your code catches that just fine. :-)
3 - Instead of going back to thisSite.php and displaying the error
message, it goes to anotherSite.php.
Yes. Because you forgot the exit command.
4 - If I then hit the back arrow on the browser, it displays with the
error message on thisSite.php
Well...
The infamous BACK-button.
I hate that thing.

I have really nothing constructive to tell you on this point.

As far as my experience goes: It is implemented differently on different
browsers.
I have seen the following things (over many years):
Some just fetch the HTML from cache and display that.
Or maybe some even repost (if a form was used to produce the HTML) without
your knowledge.
Others warn you you are viewing possibly out-of-date html.
Or they warn you that you are reposting the form.

Of course you can modify their behavious with extra option in headers
concerning cache-control, document-expires, etc. etc.

Everything is possible and it gives me a headache.

I have no idea how the current mostly used browser behave.
Maybe things improved and they all do the same, but I doubt it.


It seems that
1 - on the submit it goes through the logic and sets the error.
Yes.
2 - It then must be going through a second time, but this time taking on
the default setting of "any" for control A and so bypass the logic on the
zip code and so goes to anotherSite.php.
Because of the missing exit, but I told you that already. :-)

Please help me here.

I hope I did.

Regards,
Erwin Moller
Shelly


Aug 1 '05 #8
Shelly wrote:
// Verify that a Zip code is numeric and is five digits


don't forget that other countries use different zip codes. Australia
uses 4 and uk uses a 6 digit alpha numeric.
Aug 2 '05 #9

"junk" <ju**@bigpond.com> wrote in message
news:kM******************@news-server.bigpond.net.au...
Shelly wrote:
// Verify that a Zip code is numeric and is five digits


don't forget that other countries use different zip codes. Australia uses
4 and uk uses a 6 digit alpha numeric.


Right now this site is restricted to the US (Canada, too, if they use a 5
digit zip. However, expansion will take place (later).
Aug 2 '05 #10
On Tue, 02 Aug 2005 01:27:50 +0000, Shelly decided we needed to hear:

<snip>
Right now this site is restricted to the US (Canada, too, if they use a 5 digit zip. However, expansion will take place (later).


FYI Canada uses 6 char alphanumeric in a similar way to the UK. I guess
your site is US only for now ;)
--
Dave <da**@REMOVEbundook.com>
(Remove REMOVE for email address)

Aug 2 '05 #11

"Dave" <da**@REMOVEbundook.com> wrote in message
news:pa****************************@REMOVEbundook. com...
On Tue, 02 Aug 2005 01:27:50 +0000, Shelly decided we needed to hear:

<snip>
Right now this site is restricted to the US (Canada, too, if they use

a 5
digit zip. However, expansion will take place (later).


FYI Canada uses 6 char alphanumeric in a similar way to the UK. I guess
your site is US only for now ;)


Yes. Even if they used 5 digits I wouldn't be able to use it now because my
database for latitude and longitude is just for the US.

Shelly
Aug 2 '05 #12
JDS
On Mon, 01 Aug 2005 15:34:30 +0000, Shelly wrote:
"JDS" <je*****@example.invalid> wrote in message
news:pa***************************@example.invalid ...
There are several things that I am not crazy about in your code. And your
usenet post

0) looks like you have MULTI-posted, not CROSS-posted. There is an
important distinction.
Please explain. I merely wanted to be polite and say that I had also posted
it in another forum.


Cross-posting means including a list of newsgroups in the post-to list at
post time. Multi-posting means sending out the same message to different
newsgroups, one at a time.

1) you may want to consider using "and" instead of "&&". See:
http://www.php.net/manual/en/languag...ors.precedence
(minor issue)
I'll look at it. I am so used to C and Java coding (new to the web coding
and PHP) that I used the ones I knew.


Its no big deal, really, just that operator precedence may bite you. Be
sure to use parentheses and you should be fine.

2) Why use strcmp() when == will do? In any case, according to your step
Force of habit (and it would be !=, not ==).. I use strcmp because of past
programming experience. To compare strings you use strcmp (or an
equivalent). An "==" compares the addresses of the two items and not the
values of the two items, since strings are arrays in these other languages.


I guess not such a bad habit, but I find "$string == 'string'" much easier
to read than "srtcmp($string, 'string')". Also, note that PHP has a "==="
operator which tests for typing as well as value.
number (2) what you do will not trigger true in "if (strcmp($A, "any") {"
so it will just skip all that stuff and drop out to the final Location
header -- anotherSite.php
The strcmp is correct. If $A is NOT equal to "any", then strcmp returns
other than zero and the code IS perfermed. That is what I want to happen.


Allrighty.

<snip stuff about typos and servers>
6) You are supposed to use absolute URLs when doing a
"header('Location:...')" redirection. Most browsers and servers and PHP
itself are flexible in this regard, but the "official" requirement is
the full URI including "http://".


Mine works with relative URLs.


Well, I don't know the specs all that well,
admitedly. More info: http://www.php.net/header
<snip other stuff>
Thank you for your time and suggestions.

Shelly


You're welcome. I dated a Shelly once. Spelled "Shelley" though. I think.

later...
--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Aug 2 '05 #13
I noticed that Message-ID:
<pa****************************@example.invalid> from JDS contained the
following:
Shelly


You're welcome. I dated a Shelly once. Spelled "Shelley" though. I think.


And not short for Sheldon, no doubt...

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Aug 2 '05 #14

"JDS" <je*****@example.invalid> wrote in message
news:pa****************************@example.invali d...
On Mon, 01 Aug 2005 15:34:30 +0000, Shelly wrote:
"JDS" <je*****@example.invalid> wrote in message
news:pa***************************@example.invalid ...
There are several things that I am not crazy about in your code. And
your
usenet post

0) looks like you have MULTI-posted, not CROSS-posted. There is an
important distinction.
Please explain. I merely wanted to be polite and say that I had also
posted
it in another forum.


Cross-posting means including a list of newsgroups in the post-to list at
post time. Multi-posting means sending out the same message to different
newsgroups, one at a time.


Ah, I multi-posted. However, it seems like six of one and a half dozen of
the other.

1) you may want to consider using "and" instead of "&&". See:
http://www.php.net/manual/en/languag...ors.precedence
(minor issue)


I'll look at it. I am so used to C and Java coding (new to the web
coding
and PHP) that I used the ones I knew.


Its no big deal, really, just that operator precedence may bite you. Be
sure to use parentheses and you should be fine.


I'm a bit of a fanatic about parentheses. I always use them if there is the
slightest chance of not being read correctly.
2) Why use strcmp() when == will do? In any case, according to your
step


Force of habit (and it would be !=, not ==).. I use strcmp because of
past
programming experience. To compare strings you use strcmp (or an
equivalent). An "==" compares the addresses of the two items and not the
values of the two items, since strings are arrays in these other
languages.


I guess not such a bad habit, but I find "$string == 'string'" much easier
to read than "srtcmp($string, 'string')". Also, note that PHP has a "==="
operator which tests for typing as well as value.


Is that 3 equals signs? It is hard to read the above as they run together
here. Interesting, though.
number (2) what you do will not trigger true in "if (strcmp($A, "any")
{"
so it will just skip all that stuff and drop out to the final Location
header -- anotherSite.php


The strcmp is correct. If $A is NOT equal to "any", then strcmp returns
other than zero and the code IS perfermed. That is what I want to
happen.


Allrighty.

<snip stuff about typos and servers>
6) You are supposed to use absolute URLs when doing a
"header('Location:...')" redirection. Most browsers and servers and PHP
itself are flexible in this regard, but the "official" requirement is
the full URI including "http://".


Mine works with relative URLs.


Well, I don't know the specs all that well,
admitedly. More info: http://www.php.net/header


I changed them all, everywhere in my code, to absolute URLs.
<snip other stuff>
Thank you for your time and suggestions.

Shelly


You're welcome. I dated a Shelly once. Spelled "Shelley" though. I
think.


You wouldn't like my type :-). It is a gender thing. Besides, my wife of
42 years might object :-). The name on my birth certificate is Sheldon.

Shelly
Aug 2 '05 #15
Shelly wrote:

"JDS" <je*****@example.invalid> wrote in message
news:pa****************************@example.invali d...

Cross-posting means including a list of newsgroups in the post-to
list at post time. Multi-posting means sending out the same
message to different newsgroups, one at a time.


Ah, I multi-posted. However, it seems like six of one and a half
dozen of the other.


Not really, no. With cross-posting, two useful things happen. Replies
from one group will be seen in all (assuming that the cross-post wasn't
removed by the respondant) and for those with sensible newsreader the
message will be marked as read in all groups once it's read in one

Brian
Aug 2 '05 #16
JDS
On Tue, 02 Aug 2005 22:33:10 +0000, Shelly wrote:
<snip!> Ah, I multi-posted. However, it seems like six of one and a half dozen of
the other.
No! They are significantly different from each other. Multi-posting
creates independent threads that cannot be (easily) tracked together;
cross-posting creates a cohesive thread spread across multiple groups.
If you keep multi-posting, you will hear other complaints. You have been
warned.
<snip!>
I'm a bit of a fanatic about parentheses. I always use them if there is the
slightest chance of not being read correctly.
Sounds good. Personally, I hate even the shortcut of (for example):

if (1) do thing;

No curlies!

I much prefer
if (1){
do thing;
}

Even for one-line things.
<snip snip!> Is that 3 equals signs?


Yes.

http://us2.php.net/manual/en/languag...comparison.php

<snip snip snip!>
You're welcome. I dated a Shelly once. Spelled "Shelley" though. I
think.


You wouldn't like my type :-). It is a gender thing. Besides, my wife of
42 years might object :-). The name on my birth certificate is Sheldon.

Shelly


Well, I *could* be gay.

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Aug 4 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: trialanderror | last post by:
I've been happily chugging along thinking I understood floating divs and now find that I know a lot less than I thought I did. And the more I try "fixing" things, the worse it gets. A lot of what...
18
by: eddiew_AUS | last post by:
while playing around to check <blah> for my personal project, I discovered an anomaly with my code, compiled using (cringe) visual studio ver 6: #include<iostream> using namespace std; ...
3
by: Jason Kyle Baginski | last post by:
Here's a little test app to demonstrate a problem I'm having. It creates four buttons, each one with the different FlatStyle types available. Three of them behave exactly the same way(and the...
18
by: Patrick Wood | last post by:
I found a problem with C# and post increments. I was going through some source code in c++ and found someone did a post increment: int x=0; for(int i=0; i<10; i++) { x = x++; }
8
by: Glenn | last post by:
Hi! I've developed an app that displays multiple textbox and combobox fields (most of which are autopostback) on a form along with a submit button. My users find it confusing when they change...
4
by: Julia | last post by:
Hi Everyone, I am using webbrowser control to post data to an aspx page. However, for some reason, the aspx page sometimes will execute page_load event twice, and sometimes execute it once. So I...
2
by: 2obvious | last post by:
Below is a cut-and-paste code example that runs. It demonstrates some results which confuse me. It uses a DataGrid to make a table with 12 rows, each containing a TextBox and a CustomValidator....
10
by: Danny | last post by:
Hi all, I am having some odd problems with AJAX on Firefox (1.5). When I use GET as the request method everything works ok, but when I do a POST the remote function doesn't get the parameters I...
0
by: deacon57 | last post by:
FYI - If you are a computer scientist (or geek), this post may be for you. I wanted to log any search keywords, etc that are used on my site. I created a simple program that logs search terms...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.