-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.php
54 lines (44 loc) · 1.6 KB
/
Home.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
45
46
47
48
49
50
51
52
53
54
<!-- Home Page for website -->
<?php
session_start();
if (isset($_SESSION["login_error"])) {
echo '<script>alert("' . $_SESSION["login_error"] . '");</script>';
unset($_SESSION["login_error"]); // Clear the error after displaying it
}
if (isset($_SESSION["register_success"])) {
echo '<script>alert("' . $_SESSION["register_success"] . '");</script>';
unset($_SESSION["register_success"]); // Clear the success message after displaying it
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Survey Engine</title>
<link rel="stylesheet" href="css/home-styles.css">
</head>
<body>
<h1>Survey Engine</h1>
<hr>
<div class="container">
<!-- Login Form -->
<!-- Need to determine when to send to admin or user page -->
<!-- This will be determined via the database -->
<form action="LoginHandler.php" method="post">
<label for="email">E-mail:</label>
<input type="email" name="email" id="email" required>
<br>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required>
<br>
<input type="submit" value="Login">
</form>
<!-- Register Form -->
<p>Don't have an account? <a href="CreateAccount.php">Register here!</a></p>
</div>
<?php
session_unset();
session_destroy();
?>
</body>
</html>