Lukey Posted May 23, 2007 Share Posted May 23, 2007 Hi ive created a registration form that has various input text boxes including a "password" and a "verify password" one. My issue is that when it comes to checking the two password boxes are matching. At first i thought it was my syntax etc. but i've narrowed it down to the fact that my code isnt picking up the first password text box at all. Example: //variables for entered data $firstname = $_POST["fname"]; $secondname = $_POST["sname"]; $housenumber = $_POST["hnumber"]; $streetname = $_POST["streetname"]; $townname = $_POST["townname"]; $countyname = $_POST["countyname"]; $country = $_POST["countryname"]; $email = $_POST["emailaddress"]; $phoneno = $_POST["phonenum"]; $username = $_POST["Rusername"]; $pass = $_POST["pword"]; $vpassword = $_POST["vpword"]; ... //testing variable output echo($pass); echo($vpassword); $vpassword displays but $pass does not so im sure its not picking up this information. I have checked that i got the correct names etc numerous times now. Im sure the answer is probably staring me in the face. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/ Share on other sites More sharing options...
AV1611 Posted May 23, 2007 Share Posted May 23, 2007 can we see the relevant section of the form? Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260110 Share on other sites More sharing options...
Lukey Posted May 23, 2007 Author Share Posted May 23, 2007 sure thing. <td><div align="left"> <input type="password" name="pword" size="20" maxlength="20" value=""/><br/> <font size=-2><i>Note: Password must be a minimum of 6 characters</i></font> </div> </td> </tr> <tr> <!-- Row 12 Column 1 --> <td><div align="right"> Verify Password: </div> </td> <!-- Row 12 Column 2 --> <td><div align="left"> <input type="password" name="vpword" size="20" maxlength="20" value=""/> </div> </td> Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260116 Share on other sites More sharing options...
AV1611 Posted May 23, 2007 Share Posted May 23, 2007 change <input type="password" name="vpword" size="20" maxlength="20" value=""/> to <input type="password" name="vpword" size="20" maxlength="20" /> Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260125 Share on other sites More sharing options...
Lukey Posted May 23, 2007 Author Share Posted May 23, 2007 Nope still refuses to display the first one echo($pass); it displays echo($vpassword); fine. Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260192 Share on other sites More sharing options...
per1os Posted May 23, 2007 Share Posted May 23, 2007 Try echoing the post <?php echo $_POST['pword']; ?> See what happens. Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260197 Share on other sites More sharing options...
Lukey Posted May 23, 2007 Author Share Posted May 23, 2007 Yea that works it displays it! All im trying to do is to compare $pass and $vpassword and continue if they match and throw up an error if they dont. Should be simple I've tried all sorts of didnt types of if statements! Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260209 Share on other sites More sharing options...
Lukey Posted May 23, 2007 Author Share Posted May 23, 2007 ok so if works if i do this if($_POST["pword"] != $vpassword) { echo($retypepass); } however it does not word if i use $pass strange how it $pass wont accept the password as a string. Quote Link to comment https://forums.phpfreaks.com/topic/52683-problem-with-my-registration-form/#findComment-260212 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.