-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewCOM.php
67 lines (44 loc) · 1.23 KB
/
viewCOM.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
session_start();
require 'connect.php';
require 'functions.php';
if(isset($_SESSION['username'], $_SESSION['password'])) {
?>
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url("assets/img/bg4.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<title>View - COM</title>
<link href="bootstrap.min.css" rel="stylesheet">
<link href="main.css" rel="stylesheet">
</head>
<body>
<?php
// Get image data from database
$result = $con->query("SELECT COM FROM documents WHERE username = '".$_SESSION['username']."' AND password = '".$_SESSION['password']."'");
?>
<?php if($result->num_rows > 0){ ?>
<div class="gallery">
<?php while($row = $result->fetch_assoc()){ ?>
<img src="./image/<?php echo($row['COM']); ?>" />
<?php } ?>
</div>
<?php }else{ ?>
<p class="status error">Image(s) not found...</p>
<?php } ?>
<a class="btn btn-secondary" href="profile.php" role="button">Go Back</a>
<?php
} else {
header("location:index.php");
exit;
}
unset($_SESSION['prompt']);
mysqli_close($con);
?>