reel_biggy_fish Posted September 4, 2010 Share Posted September 4, 2010 Hi, i am really struggling to think what to search for or even what to do. what i want to do is when a user wants to change his or her password i want two textboxes and both must match before they can continue so they dont make a mistake and never login again. could someone point me in the direction of what to search for. would be very helpful thanks in advance Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 4, 2010 Share Posted September 4, 2010 EDIT: Sorry, just noticed that this is in the JS section, not the PHP section. Anyhow, if you want to validate the fields with PHP, this will help Form field validation. Something like this (brief) example should get you started: <?php if( $_POST['submitted'] == 'yes' ) { if( $_POST['pass_1'] != $_POST['pass_2'] ) { // fields don't match, so do something to indicate the error . . . } } ?> <form action="" method="post"> <input type="text" name="pass_1" /> <input type="text" name="pass_2" /> <input type="hidden" name="submitted" value ="yes" /> <input type="submit" name="submit" value="Submit Form" /> </form> Quote Link to comment Share on other sites More sharing options...
reel_biggy_fish Posted September 5, 2010 Author Share Posted September 5, 2010 ahhh wicked. thanks. i shall now be able to crack on. i did think about php but still unsure what id search for. thanks for your help Quote Link to comment Share on other sites More sharing options...
danieljgraham Posted September 5, 2010 Share Posted September 5, 2010 Another useful function is if(empty($login_Username) || empty($login_Password)) { throw new Exception("Error, Please enter your Username and Password!"); } Quote Link to comment 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.