-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessAdmin.php
More file actions
31 lines (26 loc) · 1.05 KB
/
processAdmin.php
File metadata and controls
31 lines (26 loc) · 1.05 KB
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
<?php
if(isset($_POST['admin_usrname']) && isset($_POST['admin_psw']) ) {
if( !empty($_POST['admin_usrname']) && !empty($_POST['admin_psw']) ){
$username = htmlentities($_POST['admin_usrname']);
$password = htmlentities($_POST['admin_psw']);
require 'connect.php';
if($username == "admin" && $password=="12345") {
$_SESSION['name'] = 'Admin';
header("Location: dashboardA.php");
} else {
echo 'Wrong !!';
$msg = 'Missing Entries !';
$cookie_value = '<script>alert(\''.$msg.'\');</script>';
setcookie("message", $cookie_value, time() + (86400 * 30), "/");
header('Location: index.php');
}
}
else {
echo 'Fill the entries !';
$msg = 'Missing Entries !';
$cookie_value = '<script>alert(\''.$msg.'\');</script>';
setcookie("message", $cookie_value, time() + (86400 * 30), "/");
header('Location: index.php');
}
}
?>