Re: PHP Curiosity
by "Darrell King" <darrell(at)webctr.com>
|
| Date: |
Mon, 8 Mar 2004 10:52:44 -0500 |
| To: |
"Buddy Harris" <bharris(at)stny.rr.com>, "HWG Techniques" <hwg-techniques(at)hwg.org> |
| References: |
rr |
| |
todo: View
Thread,
Original
|
|
It seems like it should be one of two things:
1) You had a typo that you corrected without realizing when you changed the
variable names.
2) You were using or had assigned values to those variables in another part
of the script and they were getting overwritten.
Both $pwd and $itemnum are legal variables for PHP in general, so it has to
be specific to your app. Open all the scripts in this application and any
prepend files and do a search for the variable names and see if they come up
at other locations.
D
----- Original Message -----
From: "Buddy Harris" <bharris(at)stny.rr.com>
To: <hwg-techniques(at)hwg.org>
Sent: Monday, March 08, 2004 12:33 PM
Subject: PHP Curiosity
I'm just wondering if anyone knows the explanation for this:
I'm making a simple PHP/MySql admin app so the lady can add or delete items
on her catalog page.
When I use:
if ( $pwd != 'test' ) {
echo "<h2>wrong Password</h2>\n";
exit;
}
The echo "wrong Password\n"; exit; would occur regardless of what was in the
form field.
I changed the variable from "$pwd" to "$pass" and it worked as expected.
I had the variable "$itemnum" further down in the script. The PHP
verification page displayed it but
the MySql column came up empty. I changed that to "$number" and it went into
the database as expected.
(On both, I copy/pasted the variables from the HTML form to the PHP script
so I know they were the same.)
Is there a reasonable explanation for this or does PHP get to choose the
variables it likes?
Thanks,
Buddy
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.