Repository navigation
Expand file tree
/
Copy pathAddReview.php
More file actions
104 lines (96 loc) · 3.02 KB
/
Copy pathAddReview.php
File metadata and controls
104 lines (96 loc) · 3.02 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
// Start the session
if(session_status() !== PHP_SESSION_ACTIVE)
{
session_start();
// If the session variable userLogin does not exist then create one.
if (!isset($_SESSION['userLogin'])) {
$_SESSION['userLogin'] = False ;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Programming Reviews | Add Reviews</title>
<link href="projectStyle.css" type="text/css" rel="stylesheet">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="images/favicon.ico">
</head>
<body>
<div id="banner"> <!-- header banner -->
<header>
<h1>Programming Reviews</h1>
</header>
</div>
<nav> <!-- nav bar -->
<ul>
<li><a href="home.php">Home Page</a></li>
<li><a href="readReviews.php">Read Review</a></li>
<li><a class="active" href="AddReview.php">Add Review</a></li>
<li><a href="searchReview.php">Search</a></li>
<li><a href="signUp.php">Sign Up</a></li>
<li><a href="logIn.php">Log In</a></li>
</ul>
</nav>
<main>
<div id="area1"> <!-- main area -->
<h1>Add Reviews</h1>
<?php
//if a user is logged in then display content
if ($_SESSION['userLogin'] == true){
//form lets users submit a review
echo '<p>Use the form below to write and submit your own review.</p>
<div class="addform">
<form action="AddReview2.php" method="POST">
<p>Review Language:</p>
<input type="text" name="reviewLanguage" maxlength="20" placeholder="Please enter your review language here" autocomplete="off" required>
<br><br>
<p>Review Text:</p>
<input type="text" name="reviewText" maxlength="250" placeholder="Please enter your review text here" autocomplete="off" required>
<br><br>
<p>Review Rating:</p>
<input type="number" name="reviewRating" min="1" max="5" placeholder="1" autocomplete="off" required>
<input type="submit" value="Submit">
</form>
</div>';
//else display error message saying you must be logged in
} else {
echo '<p>You must be logged in to view this content!</p>';
}
?>
</div>
</main>
<footer>
<div class="col1"> <!-- footer download column -->
<h2>Download our App</h2>
<ul>
<li>Download on the app store or google play store</li>
</ul>
<div class="app-logo">
<img src="images/play-store.png" alt="playstore.png">
<img src="images/app-store.png" alt="appstore.png">
</div>
</div>
<div class="col2"> <!-- footer contact column -->
<h2>Contact us</h2>
<ul>
<li>Tel: 0131 345 6789</li>
<li>Fax: 0131 987 6543</li>
<li>Email: [email protected]</li>
</ul>
</div>
<div class="col3"> <!-- footer socials column -->
<h2>Follow us</h2>
<ul>
<li class="fb">Facebook</li>
<li class="tw">Twitter</li>
<li class="in">Instagram</li>
<li class="yt">YouTube</li>
</ul>
</div>
</footer>
</body>
</html>