-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfile.php
More file actions
50 lines (32 loc) · 1.47 KB
/
Copy pathfile.php
File metadata and controls
50 lines (32 loc) · 1.47 KB
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
<?php
$conn = new mysqli('localhost', 'izu', 'toor'); # change you local server
mysqli_select_db($conn, 'db_member'); # use database if you change
if (isset($_GET['username']) && $_GET['username'] != '' && isset($_GET['password']) && $_GET['password'] != '')
{
$email = $_GET['username'];
$password = $_GET['password'];
$getData = "SELECT `ur_Id`,`ur_username`,`ur_password` FROM `tbl_user` WHERE `ur_username`='" .$email."'
and `ur_password`='".$password."'";
$result = mysqli_query($conn,$getData);
$userId="";
while( $r = mysqli_fetch_row($result))
{
$userId=$r[0];
}
if ($result->num_rows > 0 ){
$resp["status"] = "1";
$resp["userid"] = $userId;
$resp["message"] = "Login successfully";
}else{
$resp["status"] = "-2";
$resp["message"] = "Enter correct username or password";
}
}else
{
$resp["status"] = "-2";
$resp["message"] = "Enter Correct username.";
}
header('content-type: application/json');
$response["response"]=$resp;
echo json_encode($response);
@mysqli_close($conn);