-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain_page.php
More file actions
38 lines (37 loc) · 983 Bytes
/
main_page.php
File metadata and controls
38 lines (37 loc) · 983 Bytes
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
<?php
session_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="content-box">
<?php
if ($_SESSION["connected"] == 1) { ?>
<div class="info">Welcome <?php echo $_SESSION["username"]?>!</div>
<?php
if ($_SESSION["voted"] == 0) {
echo '<div class="info">You have not voted yet!</div>';?>
<button class="button" onclick="location.href='vote.php'">Vote</button><?php
}
else {
echo '<div class="info">You have already voted</div>';
}
?><br>
<div class="user-box">
What will you do?<br>
</div>
<button class="button" onclick="location.href='logout.php'">Logout</button>
<?php
} else {?>
<div class="wrong">
Sorry, you are not a valid user, please login!
</div>
<button class="button" onclick="location.href='logout.php'">back</button>
<?php } ?>
<br>
</div>
<body>
</html>