-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_gallery.php
More file actions
49 lines (48 loc) · 1.35 KB
/
Copy pathview_gallery.php
File metadata and controls
49 lines (48 loc) · 1.35 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
<?php
include_once 'includes/config.php';
if (isset($_GET['status2'])&&isset($_GET['mod'])) {
?>
<div class="gallery">
<h1>Gallery!</h1>
<?php
$hosel_id=$_GET['status2'];
$db=mysqli_connect($DBServer, $DBUser, $DBPass, $DBName);
$query = "SELECT * FROM gallery where hostel_id='".$hosel_id."'";
$result = $db->query($query);
if (!empty($result)) {
?>
<?php
while ($item = mysqli_fetch_assoc($result)) {
?>
<img src="<?php echo 'graphics/hostels/'.$item['picture'] ?>" alt="No Picture">
<?php
}
}
sleep(2);
?></div>
<?php
}
else if (isset($_GET['status2'])&&(!isset($_GET['mod']))) {
?>
<div class="gallery">
<?php
$hosel_id=$_GET['status2'];
$db=mysqli_connect($DBServer, $DBUser, $DBPass, $DBName);
$query = "SELECT * FROM gallery where hostel_id='".$hosel_id."'";
$result = $db->query($query);
if (!empty($result)) {
?>
<?php
while ($item = mysqli_fetch_assoc($result)) {
?>
<img src="<?php echo 'graphics/hostels/'.$item['picture'] ?>" alt="No Picture">
<?php
}
}
?></div>
<?php
}
else
{
echo 'Not found!';
}?>