-
Notifications
You must be signed in to change notification settings - Fork 0
/
authchallenge.php
34 lines (30 loc) · 908 Bytes
/
authchallenge.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
<?php
include_once "connection.php";
if(isset($_POST['btnAdminLogin']))
{
$admin_username = $_POST['adminusername'];
$admin_pwd = $_POST['adminpassword'];
$query = mysql_query("select * from admin WHERE username = '$admin_username'");
$result = mysql_fetch_object($query);
if($result)
{
$storedUsername = $result->username;
$storedPwd = $result->password;
}
if((null == $_POST['adminusername']) || (null == $_POST['adminpassword']))
{
header("Location: login.php");
}
else if($storedUsername == $_POST['adminusername']
&&
$storedPwd == $_POST['adminpassword'])
{
header("Location: index.php");
}
else
{
$auth = "fail";
header("Location: login.php");
}
}
?>