-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
44 lines (26 loc) · 814 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
36
37
38
39
40
41
42
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
include('dbcon.php');
//POST 값을 읽어온다.
$useremailid=isset($_POST['useremailid']) ? $_POST['useremailid'] : '';
$userpassword=isset($_POST['userpassword']) ? $_POST['userpassword'] : '';
$android = strpos($_SERVER['HTTP_USER_AGENT'], "Android");
if ($useremailid != "" && $userpassword !='' ){
$sql="select userindex from userinfo where userid='$useremailid' and userpassword = '$userpassword'";
$stmt = $con->prepare($sql);
$stmt->execute();
if ($stmt->rowCount() == 0){
$result ="존재하지 않는 유저";
}
else{
$row=$stmt->fetch(PDO::FETCH_ASSOC);
extract($row);
$result = "success".$row['userindex'];
}
}
else {
$result ="error";
}
echo $result;
?>