-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.php
49 lines (43 loc) · 1.21 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
41
42
43
44
45
46
47
48
49
<main>
<?php
include('header.php');
include('navi.php');
session_start();
$db = new Datenbank;
$mysqli = $db->verbindung();
$youtube = "";
$homepage = "";
$forum = "";
$tipps = "";
if(isset($_GET['idgame'])){
$gameid = $_GET['idgame'];
}
$query = "SELECT * FROM games WHERE gameid = ?";
if($statement = $mysqli->prepare($query)){
$statement -> bind_param("i", $gameid);
$statement -> execute();
$result = $statement -> get_result();
if(($row = $result->fetch_assoc()) != null){
$youtube = $row['youtube'];
$homepage = $row['homepage'];
$forum = $row['forum'];
$tipps = $row['tipps'];
}
} else {
echo "Keine Links in der Datenbank";
}
include('content.php');
if(strlen($youtube) != 0) {
?><iframe id="youtube" width="350" height="315" src="https://www.youtube.com/embed/<?php echo $youtube;?>" frameborder="0" allowfullscreen></iframe><?php
}
if(strlen($homepage) != 0) {
?><br><a id="homepage" href="<?php echo $homepage; ?>">Homepage</a><?php
}
if(strlen($forum) != 0) {
?><br><a id="forum" href="<?php echo $forum; ?>">Forum zum Spiel</a><?php
}
if(strlen($tipps) != 0) {
?><br><a id="tipps" href="<?php echo $tipps; ?>">Tipps zum Spiel</a><?php
}
include('footer.php');
?>