Jump to content

Complicated idea.. Need some help implementing.


virtuexru

Recommended Posts

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.

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";
  }

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.