-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgallery.php
45 lines (31 loc) · 894 Bytes
/
gallery.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
<?php
// for error logging incase of fail
error_reporting(E_ALL);
ini_set('display_errors', 1);
// loads the dynamic header
$page_name="gallery";
require_once('inc/header.php');
// loading database
require_once('inc/lib.php');
connect();
$sql = "SELECT * FROM images";
$result = mysqli_query($conn, $sql);
echo '<div id="gallery" class="gallery">';
echo '<div class="gallery-container">';
while($row = mysqli_fetch_assoc($result)) {
echo '<div class="gallery-item">';
echo '<a href = "inspect.php?id=' . $row["id"] . '">';
echo '<img src = "images/artwork/' . $row["id"] . '.png" alt = "artpiece name = ' . $row["title"] . '">';
echo '</a>';
echo '<span>' . $row["title"] . '</span>';
echo '</div>';
}
echo '</div>';
echo '</div>';
?>
<body>
<!-- main content of the page -->
<div id="back_gradient"></div>
<?php include 'inc/footer.php'; ?>
</body>
</html>