-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
44 lines (39 loc) · 1.32 KB
/
login.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
42
43
44
<?php
/*
* inc header file containing html tags*/
include "app/header.php";
/*
* Main body area for login code*/
if (isset($_POST["login"]))
{
$username = $_POST['username']; //captures username input from the html form
$password = $_POST['password']; //captures password input from the html form
if ($username == "admin" && $password == "admin")
{
//start a session
//initialize and declare the session
//redirect the user to the home page
session_start();
$_SESSION["session_user"]=$username;
header("location: default.php");
}elseif ($username == "manager" && $password == "manager"){
//start a session
//initialize and declare the session
//redirect the user to the home page
session_start();
$_SESSION["session_user"]=$username;
header("location: default.php");
}elseif ($username == "delivery" && $password == "delivery"){
//start a session
//initialize and declare the session
//redirect the user to the home page
session_start();
$_SESSION["session_user"]=$username;
header("location: default.php");
}else {
header("location: index.php");
}
}
/*
* inc footer containing closer tags*/
include "app/footer.php";