-
Notifications
You must be signed in to change notification settings - Fork 2
/
app_login.php
83 lines (51 loc) · 1.61 KB
/
app_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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
include "db_connection.php";
$name = null;
$email=null;
$phone=null;
$address=null;
$password=null;
$user_id=null;
if($_SERVER['REQUEST_METHOD']=='POST')
{
$email=$_POST['email'];
$password=$_POST['password'];
}
if($_SERVER['REQUEST_METHOD']=='GET')
{
$email=$_GET['email'];
$password=$_GET['password'];
}
$sql_select="SELECT * FROM `user_data` WHERE `email`='$email' && `password`= '$password' ";
$result_select=mysqli_query($conn,$sql_select);
$result_count=mysqli_num_rows($result_select);
if($result_count>0)
{
while($row=mysqli_fetch_array($result_select))
{
$name=$row['name'];
$phone=$row['phone'];
$address=$row['address'];
$password=$row['password'];
$email=$row['email'];
$user_id=$row['user_id'];
$UserDetails=array(
"user_id" =>$user_id,
"name" =>$name,
"phone"=>$phone,
"address" => $address,
"password" => $password,
"email" => $email
);
}
}
if($result_count)
{
$response=array("response"=> $UserDetails);
echo json_encode($response);
}else
{
$response=array("response"=> "failure");
echo json_encode($response);
}
?>