forked from Th3-822/rapidleech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
58 lines (57 loc) · 1.55 KB
/
Copy pathdelete.php
File metadata and controls
58 lines (57 loc) · 1.55 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
50
51
52
53
54
55
56
57
58
<?php
function delete() {
global $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="delete_go" />
<?php
echo lang(count($_GET['files']) > 1 ? 379 : 104).':';
foreach ($_GET['files'] as $k => $v) {
echo '<input type="hidden" name="files[]" value="'.$v.'" /><br />';
echo '<b>'.htmlentities(basename($list[$v]['name'])).'</b>';
}
?>
<br />
<?php echo lang(148); ?>?
<br />
<table>
<tr>
<td><input type="submit" name="yes" style="width: 33px; height: 23px"
value="<?php echo lang(149); ?>" />
</td>
<td> </td>
<td><input type="submit" name="no" style="width: 33px; height: 23px"
value="<?php echo lang(150); ?>" />
</td>
</tr>
</table>
</form>
<?php
}
function delete_go() {
global $list, $PHP_SELF;
if (isset($_POST["yes"])) {
for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
$file = $list [$_POST ["files"] [$i]];
if (file_exists ( $file ["name"] )) {
if (@unlink ( $file ["name"] )) {
printf(lang(151),basename($file['name']));
echo "<br />";
unset ( $list [$_POST ["files"] [$i]] );
} else {
printf(lang(152),basename($file['name']));
echo "<br />";
}
} else {
unset ( $list [$_POST ["files"] [$i]] );
printf(lang(145),basename($file['name']));
echo "<br />";
}
}
if (! updateListInFile ( $list )) {
echo lang(146)."<br /><br />";
}
} else {
echo('<script type="text/javascript">location.href="'.$PHP_SELF.'?act=files";</script>');
}
}
?>