virtuexru Posted March 13, 2007 Share Posted March 13, 2007 OK, first off, I know this can be done, but can it be done using PHP? Any feedback is appreciated. I have a registration form, for my users. Basically what I want is this... Once a user fills out a password, he enters a second password to confirm. After he tabs to the next textfield or he's done entering the second pass, I want PHP to run a check on whether or not the passwords match, if they match, load an image of a green checkmark. I've tried doing the "onfocus" and "onkeyup" functions in the form/input, but not sure as to what direction to head. Link to comment https://forums.phpfreaks.com/topic/42575-complicated-idea-need-some-help-implementing/ Share on other sites More sharing options...
papaface Posted March 13, 2007 Share Posted March 13, 2007 Cant do this in real-time with PHP because PHP is server side. You will need to use javascript for something exactly as you described. But you can check that two passwords are the same with PHP but not in real-time (you will need to hit submit): $pw1 = $_POST['password1']; $pw2 = $_POST['password2']; if ($pw1 == $pw2) { echo "Match"; } else { echo "Passwords did not match"; } Link to comment https://forums.phpfreaks.com/topic/42575-complicated-idea-need-some-help-implementing/#findComment-206597 Share on other sites More sharing options...
brad Posted March 14, 2007 Share Posted March 14, 2007 www.newcutsmile.net/you/ try logging in to this box with no boxes filled in then try put in any random username and password. if that sort of updating is what you want, just have a google for Ajax stuff. it's kinda complicated, but if you really wanna include PHP with it you can use Ajax methods. it's not a different language, just a mix of JavaScript, DIV's and servier side scripting. Link to comment https://forums.phpfreaks.com/topic/42575-complicated-idea-need-some-help-implementing/#findComment-206710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.