Jump to content

AJAX password verification


rascle

Recommended Posts

Hi, This is a mix of Javascript and Ajax Question.

I have used the AJAX provided by an example on this site (the sticky note post)

and am altering it 2 work out if the 2 passwords provided by the user match, I was simply going to use if($password == $passwordcon){} for the PHP. However on the mainpage where the user inputs the code, the AJAX doesnt seem to be working. It appears to load the AJAX but then not save the password in the variable form, so when it is recalled it forgets it. To counter this I wanted the confirm password input, when onblur, to load the user input for Password, this is some form of Javascript but cant remember/figure it out. Here is the code:

Password: <div id="registercentre"><input type="text" name="password" id="password" onblur="javascript: MyAjaxRequest(\'main2\',\'ajaxfile.php?password=\',\'password\')" maxlength= "50" size="50" class="input1"></div><div id="help"><a href="#" onMouseover="fixedtooltip(\'Please Enter Your Password. This can be changed later.\', this, event, \'200px\')" onMouseout="delayhidetip()">[?]</a></div><br/>

Confirm Password: <div id="registercentre"><input type="text" name="passwordcon" id="passwordcon" onblur="javascript: MyAjaxRequest(\'main2\',\'ajaxfile.php?passwordcon=\',\'passwordcon\')" maxlength= "50" size="50" class="input1"></div><div id="main2"></div><div id="main3"></div><div id="help"><a href="#" onMouseover="fixedtooltip(\'Please Re-Enter Your Password. This can be changed later.\', this, event, \'200px\')" onMouseout="delayhidetip()">[?]</a></div><br/>

 

The AJAX is fine since I managed to get a username verifier working on the same page, however cant seem to get this to work. What I was considering changing to the Javascript was something like this:

Confirm Password: <div id="registercentre"><input type="text" name="passwordcon" id="passwordcon" onblur="javascript: MyAjaxRequest(\'main2\',\'ajaxfile.php?passwordcon=[color=red]&password=INPUTOFPASSWORD[/color]\',\'passwordcon\')" maxlength= "50" size="50" class="input1"></div><div id="main2"></div><div id="main3"></div><div id="help"><a href="#" onMouseover="fixedtooltip(\'Please Re-Enter Your Password. This can be changed later.\', this, event, \'200px\')" onMouseout="delayhidetip()">[?]</a></div><br/>

Help?!

Thanks

Rhys

Link to comment
https://forums.phpfreaks.com/topic/220846-ajax-password-verification/
Share on other sites

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.