-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathadmin.php
24 lines (23 loc) · 815 Bytes
/
admin.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
<?php
include_once 'dbConnection.php';
$ref = @$_GET['q'];
$username = $_POST['uname'];
$password = $_POST['password'];
$username = stripslashes($username);
$username = addslashes($username);
$password = stripslashes($password);
$password = addslashes($password);
$result = mysqli_query($con, "SELECT username FROM admin WHERE username = '$username' and password = '$password'") or die('Error');
$count = mysqli_num_rows($result);
if ($count == 1) {
session_start();
if (isset($_SESSION['username'])) {
session_unset();
}
$_SESSION["name"] = 'Admin';
$_SESSION["key"] = '54585c506829293a2d4c3b68543b316e2e7a2d277858545a36362e5f39';
$_SESSION["username"] = $username;
header("location:dash.php?q=0");
} else
header("location:$ref?w=Warning : Access denied");
?>