即时通讯用户登录惠氏改造2,它的工作原理但在响应中的问题,即使该证书是错误的,它去其他活动,即时通讯使用PHP ,注册工作正常,我不知道为什么要去其他活动。请任何帮助将采用超薄做API和mysqli的登录按钮输入活动,即使密码错误,改造2
$app->post('/login', function ($resquest, $reponse, $args) use ($app) {
require_once ('dbconnect.php');
$email = $_POST['email'];
$password = sha1($_POST['password']);
$query = "SELECT `email` ,`password` FROM `Users` WHERE `email` = '" . $email . "' AND `password` = '" . $password . "' ";
$result = $mysqli->query($query);
if ($row = $result->fetch_assoc()) {
$response = array(
'error'=>"0",
"message" => "nice"
);
} else {
$response = array(
'error'=>"1",
'message'=>"fail"
);
}
return $this->response->withJson($response);
});
你在你的回应越来越如果凭据是错了吗? –
$响应=阵列( \t \t '错误'=> “1”, \t \t “消息”=> “失败” \t \t); –