-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify_user.php
44 lines (38 loc) · 1.11 KB
/
verify_user.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
<?php include_once 'auth.php'?>
<?php
include_once 'connection.php';
if(isset($_POST['phone']) && !empty($_POST['phone']))
{
$phone = $_POST['phone'];
$password = $_POST['password'];
$sql = "Select * from user where phone = $phone and password = $password";
//echo $sql;
$result = $conn->query($sql);
if($result->num_rows>0)
{
$data = $result->fetch_assoc();
$name = $data['name'];
$user_type = $data['user_type'];
$join_data = $data['join_date'];
$package_id = $data['package_id'];
$phone = $data['phone'];
$id = $data['id'];
$_SESSION['name'] = $name;
$_SESSION['user_type'] = $user_type;
$_SESSION['join_data'] = $join_data;
$_SESSION['package_id'] = $package_id;
$_SESSION['phone'] = $phone;
$_SESSION['earning'] = $data['earning'];
$_SESSION['error'] = "";
if($user_type==1)
header("Location: admin/index.php");
else
header("Location: client/index.php");
}
else
{
$_SESSION['error'] = "Authentication Error";
header("Location: login.php");
}
}
?>