-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsession_check.php
38 lines (34 loc) · 899 Bytes
/
session_check.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
<?php
session_start();
if(isset($_SESSION['logged_in'])) //user has already logged in previously
{
/*include('dbconnect.php');
$email_check = $_SESSION['email'];
if($_SESSION['usertype'] == "customer")
{
$query = "SELECT * FROM customer_login WHERE c_email= '$email_check'";
$result = mysqli_query($conn, $query);
if(mysqli_num_rows($result) === 0)
{
header('location: Login/login.php');
}
}
else
{
$query = "SELECT * FROM dealer_login WHERE d_email= '$email_check'";
$result = mysqli_query($conn, $query);
if(mysqli_num_rows($result) === 0)
{
header('location: Login/login.php');
}
}*/
if($_SESSION["usertype"]==="customer")
{
header('location: cus_index.php');
}
else
{
header('location: dealer_index.php');
}
}
?>