if (resEntity != null) {
String resultString = EntityUtils.toString(resEntity);
Log.e("testLog", "resultString : " + resultString.trim());
if (resultString.trim().equals("OK")){
Intent intent = new Intent(Login.this, DoctorActivity.class);
startActivity(intent);
finish();
} else {
Toast.makeText(this, resultString.trim(), Toast.LENGTH_LONG).show();
}
답변미리 감사드립니다 안드로이드 소스입니다.
$query = " select user_id, pw from pati_member where user_id ='$user_id' and pw = '$pw'";
mysql_query("SET NAMES utf8");
$result = mysql_query($query,$connect);
$data = mysql_fetch_array($result);
//아무것도 입력하지 않고 로그인 버튼을 눌렀을 때
if(!$user_id)
{
echo"아이디와 비밀번호가 일치하지 않습니다.";
exit;
}
else if($data[user_id]!=$user_id)
{
echo"아이디와 비밀번호가 일치하지 않습니다.";
exit;
}
else if($data[pw]!=$pw)
{
echo"아이디와 비밀번호가 일치하지 않습니다.";
exit;
}
else
{
echo"OK";
exit;
}
mysql_close($connect);
setcookie("pl891029",$user_id,-1,"/");
?>
php 소스입니다. Toast.makeText로 비밀번호가 틀렷습니다. 넘어옵니다 하지만 "OK"도 if 문으로 들어가지 않고 else 문으로 넘어와버립니다. 답변 미리 감사합니다 ㅠㅠ