Link to home
Create AccountLog in
Avatar of mishelper
mishelper

asked on

security way for php/Ajax function to submit password

With the examples I found  in internet,

I am trying to work in php ,to apply ajax + javascript  to validate user login form with password entered.

With Ajax way it need to call "Get method" to server and pass the password as querystring to server. Will that not security enough and anything I can do better with that with Ajax?


Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

No, you can use POST but you have to do a couple of things differently.  http://www.javascriptkit.com/dhtmltutors/ajaxgetpost2.shtml  Notice the lines in red.
please refer the below...It's as secure as any other method of form submission would be to the same URL.

function login(){
    $.post('login.php', {
      username:form.username.value,
      password:form.password.value
    })
}
SOLUTION
Avatar of Proculopsis
Proculopsis

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I object to deleting this question.  I think you got several excellent answers (almost three months ago).  Any one of them would probably be acceptable.

Can you please show us your test cases, where you tried to implement the suggestions from the Experts?  We may be able to spot the issue that is still giving you trouble.  Thanks, ~Ray
Mods, can we please reopen this questions so we can see what the Asker tried from the suggestions offered here?  Thanks...
No comment has been added to this question in more than 21 days...
Ha!  No kidding.  @Tocacar: Thanks for your help here at EE.  Best to all, ~Ray
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.