I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its valid and re-direct to a members page.
Would this be secure sending it to a php script..checking with the database, then the php script either returns a true or false value?
Something like this?
function check_login(username, password)
{
var httpRequest;
make_request()
function stateck()
{
if(httpxml.readyState==4)
{
if (httpxml.responseText.indexOf("true") >= 0)
{
$("#valid_div").show();
$("#invalid_div").hide();
}
else
{
$("#invalid_div").show();
$("#valid_div").hide();
}
}
}
httpxml.onreadystatechange=stateck;
login_url="login/login.php?username=" + username.value + "password=" + password.value;
httpxml.open("GET",login_url,true);
httpxml.send(null);
}
I am planning to add an ssl certificate, so I assume this would be secure?
Thanks