-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
38 lines (33 loc) · 968 Bytes
/
index.php
File metadata and controls
38 lines (33 loc) · 968 Bytes
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
<?php
require_once 'inc/connection.php';
?>
<?php
session_start();
if(isset($_GET['tokenPassword']))
{
$tokenPassword=$_GET['tokenPassword'];
// echo $tokenPassword;
$query="SELECT * FROM admins WHERE token='{$tokenPassword}'
UNION SELECT * FROM tourist WHERE token='{$tokenPassword}'
UNION SELECT * FROM tourguide WHERE token='{$tokenPassword}'LIMIT 1";
$result_set=mysqli_query($connection,$query);
if($result_set)
{
if(mysqli_num_rows($result_set)==1)
{
$user=mysqli_fetch_assoc($result_set);
// print_r($user);
$_SESSION['email']=$user['email'];
$_SESSION['id']=$user['id'];
header('location:reset_password.php');
}
else{
header('location:expire_email.php');
}
}
}
else
{
header('location:forgot_password');
}
?>