-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
39 lines (25 loc) · 852 Bytes
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
include('dbcon.php');
//POST 값을 읽어온다.
$id=isset($_POST['id']) ? $_POST['id'] : '';
$password=isset($_POST['password']) ? $_POST['password'] : '';
$android=strpos($_SERVER['HTTP_USER_AGENT'], "Android");
$sql="select * from member where id='$id' and password='$password'";
$stmt=$con->prepare($sql);
$stmt->execute();
if ($stmt->rowCount() == 0){
echo "계정을 찾을 수 없습니다.";
} else{
$data=array();
// extract($row);
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
array_push($data,array('id'=>$row["id"],
'nickname'=>$row["nickname"],
'email'=>$row["email"]));
}
header('Content-Type: application/json; charset=utf8');
echo json_encode(array("data"=>$data), JSON_PRETTY_PRINT+JSON_UNESCAPED_UNICODE);
}
?>