-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
41 lines (34 loc) · 919 Bytes
/
index.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
<?php
/*MySQL Code*/
$servername = "localhost";
$username = "root";
$password = "test";
$dbname = "myDB";
$user_id = $_POST['email'];
$user_pwd = $_POST['password'];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//echo "Connected successfully!<br>";
$sql = "SELECT * FROM Admin where '$user_id'=Admin.Login and '$user_pwd'=Admin.Password";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "Validated As Admin";
header('Location: secondharvestdash.html');
exit();
} else{
$sql = "SELECT * FROM Sellers where '$user_id'=Sellers.Email and '$user_pwd'=Sellers.uid";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "Validated As Seller";
header('Location: Championdash.html');
exit();
} else{
//echo "Not Validated<br>";
}
}
$conn->close();
?>