I am currently working on a php project. I need to post two values, a username and password value to a php script to check that a user account exists.
I have it working fine posting the username only but don’t know how to post multiple values to it.
Below is the code that I currently have
function checkAccount()
{
var username = $(\'#txtUsername\').val();
var password = $(\'#txtPassword\').val();
$.post("phpHandler/login.php"), {username: username},
function(result)
{
if (result == "unknownUser")
{
$(\'#msg\').html("Unknown username and password").addClass(\'formError\');
$(\'#msg\').fadeIn("slow");
}
}
}
For the line
$.post(“phpHandler/login.php”), {username: username},
I tried to do
$.post(“phpHandler/login.php”), {username: username, password:
password},
but this doesn’t seem to work.
Thanks for any help you can provide
You have syntax errors all over the place between your escaped quotes and the early closing parens on your
.postcall. This code will work assuming no other issues exist in your supporting code: