-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.php
44 lines (35 loc) · 1.36 KB
/
game.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
<link rel="styleSheet" href="css/game-page.css" />
<?php
if (isset($_GET["gameID"])) {
$gID = $_GET["gameID"];
require 'includes/database.inc.php';
$sql = "SELECT * FROM Game WHERE gameID = $gID";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$gName = $row['gameName'];
$gDescription = $row['gameDescription'];
$gInstructions = $row['gameInstructions'];
$gFile = $row['gFile'];
$gSubject = $row['gameSubject'];
$gGrade = $row['gameGrade'];
$gCategory = $row['gameCategory'];
}
else {
header ("location: ./games.php");
}
$title = $gName;
include 'header.php';
include ('includes/user-config.inc.php');
echo '<div class="game-container">';
echo '<h1 class="game-name">'.$gName.'<h2>';
echo '<p class="game-desc">'.$gDescription.'</p>';
include('./games/gamefiles/'.$gFile.'');
echo '<form name="save" action="includes/save-results.php" method="post">
<input type="hidden" name="gameID" value="'.$gID.'">
<input type="text" id="score" name="score">
<button id="save-btn" type="submit" name="submit">Save Results</button>
</form></div>';
echo '<p class="game-ins">'.$gInstructions.'</p>';
echo '</div>';
include('./footer.php');
?>