Simply, users can login on my website.
$('#login').click(function() {
var user = $('#username').val();
var pass = $('#password').val();
$.ajax({
type: "POST",
url: "authorize.php",
data: { username: user, password: pass },
success: function(data) {
$('#data').html(data);
}
});
});
The ajax success: will fire regardless of the login working or not, right? It does no server-side processing. How do I communicate to the Jquery script from authorize.php that the users login has failed?
in your php do this:
Then in your ajax call add the setting:
dataType: 'json':