Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Login database

$
0
0

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);

}
?>


Viewing all articles
Browse latest Browse all 228595

Trending Articles