I use a bacbone in a first time. And i try to login There is a php.code
$data = json_decode(file_get_contents('php://input'));
if ($data) {
$name = $data->{'uname'};
$passwd = $data->{'passwd'};
echo ($name == "myname" && $passwd == "mypass") ? "Login success" : "Wrong name or password";
}
And a backbone code
var modelLogin = Backbone.Model.extend({
url: 'login.php'
});
modelLogin.save({
uname: "myName",
passwd: "myPassww",
});
How to see (e.g with alert or console.log) thw words "Login success" or "Wrong name or password"?
Thank you!