-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphotos.php
68 lines (62 loc) · 1.75 KB
/
photos.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
68
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Photos</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!--Header out here-->
<div class="topnav" id="myTopnav">
<a href="index.php">Home</a>
<a href="gallery.php">Gallery</a>
<a class="log" href="index.php?user=log">Logout</a>
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">☰</a>
</div>
<script>
function myFunction()
{
var x = document.getElementById("myTopnav");
if (x.className === "topnav")
{
x.className += " responsive";
}
else
{
x.className = "topnav";
}
}
</script>
<div class="pen-title">
<h1>St⭐rGazers</h1><span> <i class='fa fa-code'></i> </span>
</div>
<div class="container2">
<?php
session_start();
if (isset($_SESSION['username']))
{
$user = $_SESSION['username'];
$dir = "config/upload/".$user."/*.*";
$files_uo = glob($dir);
$files = array_reverse($files_uo);
for ($i = 0; $i < count($files); $i++)
{
$num = $files[$i];
$exploded = end(explode("/", $num));
$new_dir = "config/upload/".$exploded;
echo "<form class='form4' method='POST'>
<img height='300' width='400' id='display' src='".$num."' alt='image file' />
<button formaction='config/delete.php?picname=".$new_dir."&user_dir=".$num."&filename=".$exploded."' type='submit' name='delete'>Delete</button>
</form>";
}
}
else
{
header("Location: login.php?user=log");
exit();
}
?>
</div>
<div class="footer">
<p>© 2017 gsebaets</p>
</div>