dezkit Posted March 28, 2008 Share Posted March 28, 2008 //index.php <form action=passconfirm.php method=post> <input type="text" name="pass"><br> <input type="text" name="pass_c"><br> <input type="submit" value="submit"> </form> //passconfirm.php <? $pass = $_POST['pass']; $pass_c = $_POST['pass_c']; if($pass != $pass_c){ echo "Passwords do not match."; if($pass != $pass_c){ echo "Passwords match."; if($pass == false || $pass_c == false) echo "One or more of the fields were not filled in."; ?> heheh, my first 'attempt' on writing a php script, any details why it doesnt work Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/ Share on other sites More sharing options...
ohdang888 Posted March 28, 2008 Share Posted March 28, 2008 what error are you getting from it? Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502759 Share on other sites More sharing options...
ohdang888 Posted March 28, 2008 Share Posted March 28, 2008 change this: $pass = $_POST[pass]; $pass_c = $_POST[pass_c]; to this: $pass = $_POST['pass']; $pass_c = $_POST['pass_c']; Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502761 Share on other sites More sharing options...
dezkit Posted March 28, 2008 Author Share Posted March 28, 2008 change this: $pass = $_POST[pass]; $pass_c = $_POST[pass_c]; to this: $pass = $_POST['pass']; $pass_c = $_POST['pass_c']; i fixed that thanks, but im still getting a blank page when im hitting submit Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502763 Share on other sites More sharing options...
ohdang888 Posted March 28, 2008 Share Posted March 28, 2008 you have lots of errors in this: do this: <? $pass = $_POST['pass']; $pass_c = $_POST['pass_c']; if($pass != $pass_c){ echo "Passwords do not match."; } if($pass == $pass_c){ echo "Passwords match."; } if($pass == false || $pass_c == false){// This is never defined... Where are you calling this false? echo "One or more of the fields were not filled in."; } ?> Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502765 Share on other sites More sharing options...
dezkit Posted March 28, 2008 Author Share Posted March 28, 2008 ohh thanks man! by the way, whenever i dont fill in both of the fields, it says "Passwords match.One or more of the fields were not filled in." Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502766 Share on other sites More sharing options...
Tim45 Posted March 28, 2008 Share Posted March 28, 2008 Hi I just uploaded some back up files to my website and was able to get it working again but now it has a bunch of n's all over the front page. Can someone have a look and tell me what they think might fix the problem? www.allgamecheats.info Thanks Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502768 Share on other sites More sharing options...
dezkit Posted March 28, 2008 Author Share Posted March 28, 2008 can you please create a new thread tim45? Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502772 Share on other sites More sharing options...
ohdang888 Posted March 28, 2008 Share Posted March 28, 2008 thats probabaly becasue of the PHP use of "/n" Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502774 Share on other sites More sharing options...
darkfreaks Posted March 28, 2008 Share Posted March 28, 2008 <?php $pass = $_POST['pass']; $pass_c = $_POST['pass_c']; if($pass != $pass_c){ echo "Passwords do not match."; } else { echo "passwords match!";} if($pass =="" || $pass_c ==""||empty($pass)||!isset($pass)||!isset($pass_c)||empty($pass_c)) { echo "One or more of the fields were not filled in."; } ?> Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502777 Share on other sites More sharing options...
dezkit Posted March 28, 2008 Author Share Posted March 28, 2008 i got it! thanks alot! Link to comment https://forums.phpfreaks.com/topic/98259-what-am-i-doing-wrong/#findComment-502785 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.