-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
49 lines (42 loc) · 1.18 KB
/
index.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
<?php
require_once('admin/phpscripts/config.php');
if(isset($_GET['filter'])){
$tbl = "tbl_movies";
$tbl2 = "tbl_genre";
$tbl3 = "tbl_mov_genre";
$col = "movies_id";
$col2 = "genre_id";
$col3 = "genre_name";
$filter = $_GET['filter'];
$getMovies = filterType($tbl, $tbl2, $tbl3, $col, $col2, $col3, $filter);
}else{
$tbl = "tbl_movies";
$getMovies = getAll($tbl);
}
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Welcome to the Finest Selection of Blu-rays on the internets!</title>
</head>
<body>
<?php
include('includes/nav.html');
// ! means not, so not a string.
if(!is_string($getMovies)){
while($row = mysqli_fetch_array($getMovies)){
echo "<img src=\"images/{$row['movies_cover']}\" alt=\"{$row['movies_title']}\">
<h2>{$row['movies_title']}</h2>
<p>{$row['movies_year']}</p>
<a href=\"details.php?id={$row['movies_id']}\">More Details</a>
<br><br>
"; // \ makes the " not count as a close to the string the img tag is in
}
}else{
echo "<p class=\"error\">{$getMovies}</p>";
}
include('includes/footer.html');
?>
</body>
</html>