PHP Curiosity
by "Buddy Harris" <bharris(at)stny.rr.com>
|
Date: |
Mon, 8 Mar 2004 09:33:39 -0800 |
To: |
<hwg-techniques(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
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