I'm trying to authenticate the User in php but I am not consequindo some light please
if(name != '' && pw!= '') {
$http.post("http://192.168.0.133/teste.php?callback=JSON_CALLBACK", {username:name,password:pw}, function(res) {
if(res == true) {
// Make a request and receive your auth token from your server
storeUserCredentials(name + '.yourServerToken');
resolve('Login success.');
} else {
reject('Login Failed.');
}
},"json");
} else {
reject('Login Failed.');
}
});
};
teste.php
<?php
if($_POST){
if($POST['username'] == "teste" && $POST['password'] == "123"){
$response['success'] = true;
}else{
$response['success'] = false;
}
echo json_encode($response);
}
?>