-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlist.php
34 lines (29 loc) · 856 Bytes
/
list.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
<!DOCTYPE html>
<html>
<head>
<title>My Files</title>
</head>
<body>
<center>
<?php
// list all the file on the page each with a url direct to display file page
session_start();
$username = $_SESSION['uname'];
$full_path = sprintf("/srv/uploads/%s", $username);
$files = scandir($full_path);
//also enable the delete function
foreach($files as $one){
if($one !== "."&& $one !== ".."){
echo "<a href= './display.php?newf=$one'>$one</a>";
echo "<form action = './delete.php?Lname=$one' method = 'POST'>
<input type = 'submit' value= 'Delete' name = 'filename' value=$one> </input></form>";
}
}
?>
<form action = "upload.html" method = "post">
<br><br>
<input type = "submit" value = "Go Back">
</form>
</center>
</body>
</html>