knight47 Posted December 31, 2006 Share Posted December 31, 2006 What the hell is wrong with this code? it won't work! it keeps saying "nope!" this is the same code I used [URL=http://"http://knight47.com/php_scripts/pass.html"]here[/URL], that works, but this doesn't! i'm going insane![code=php:0]<?phpif ($_POST['Submit'] AND $_POST['pass'] == "ilovelambs"){echo "welcome to the password protected page";}else{echo "nope!";}?>[/code]html code: <div align="center"> <p>password: </p> <form action="pass.php" method="post" name="pass" id="pass"> <label> <input type="password" name="textfield"> </label> <p> <label> <input type="submit" name="Submit" value="Submit"> </label> </p> </form> <p> </p></div>WHY IS IT NOT WORKING! THERE IS NOTHING WRONG! Link to comment https://forums.phpfreaks.com/topic/32362-creating-a-password/ Share on other sites More sharing options...
fert Posted December 31, 2006 Share Posted December 31, 2006 change it to[code]if ($_POST['pass'] == "ilovelambs"){echo "welcome to the password protected page";}else{echo "nope!";}[/code] Link to comment https://forums.phpfreaks.com/topic/32362-creating-a-password/#findComment-150281 Share on other sites More sharing options...
knight47 Posted December 31, 2006 Author Share Posted December 31, 2006 it didn't work. :(and even if it did, why did my [url=http://knight47.com/php_scripts/pass.html]pass script[/url] that i created a while back work? Link to comment https://forums.phpfreaks.com/topic/32362-creating-a-password/#findComment-150283 Share on other sites More sharing options...
knight47 Posted December 31, 2006 Author Share Posted December 31, 2006 OHHHhhh! I figured it out!my problem lies here: <input type="password" name="[b]textfield[/b]">it should have been [b]pass[/b]Thanks for the fast reply mate. Link to comment https://forums.phpfreaks.com/topic/32362-creating-a-password/#findComment-150285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.