PHP Help Needed!!!
I am just playing with PHP with different webservers (IIS and Apache)
Running into one interesting probelm, I can't get html forms to pass variables into php script. Can anyone tell me if I did something wrong with the conf or ini files? HTML: <form method="POST" action="example18.php3"> <div align="left"> <font face="BankGothic Md BT">Admin password?</font> <input type="password" name="pw" size="14"><input type="submit" value="Submit"></p> </div></form> PHP: <? $adminpass = "test123"; if ($pw == $adminpass) { print("Welcome to the administration area!"); } else { print("Wrong password"); } ?> When I run the html and submit it tells me undefined variable pw. Anyone know why? |
Really?? No one?
|
just a random guess, try:
if($_POST['pw'] == $adminpass) if it works I can explain what is it you're doing wrong ... |
GREAT!!!!!! IT WORKS!!!!!!!! Thanx for the big help Overmind.
What did I do wrong exactly??..I was just copying and pasting the example on the webpage. :?: |
well you had nothing declaring where $pw was coming from in what you posted first of all ;)
|
ahhhhhh.................stupid website.....stupid me........
thx guys, always get what I needed to know here. |
Quote:
5vz-fe: it looks like you've been very unluky picking up the web site to learn from :|. Anyways for what you've been doing wrong read this: http://www.php.net/register_globals. Also reading through their PHP Manual is highly recommended (I know it's huge and long :shock:, but I'm unaware of any better source :(). |
Quote:
hahha well maybe, but damned if you'll see one of my servers ever running with register globals = On , even if it does mean that many of the pre coded things like commerce stores etc wont work.. just have to search harder for well coded scripts :) |
Overmind, you are totally right, you cannot believe how much trobule that stupid webpage brought me. I keep changing the php.ini script thinking that I have set the variables wrong or something. I even wipe the Apache server clean and try the IIS server instead...and still the same results...that's y I turn to u guys. <sigh>
|
All times are GMT -4. The time now is 11:43 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.