-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilebrowser.php
More file actions
47 lines (40 loc) · 895 Bytes
/
filebrowser.php
File metadata and controls
47 lines (40 loc) · 895 Bytes
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
<?php
//http://127.0.0.1/filebrowser.php?fs_path=/data/
$path = $_GET["fs_path"];
print "<pre>";
$chkbx_str="<br/><input type='radio' name='output' value=";
$chkbx_str_1=" \"/>";
//$path = "/data/";
//function list_fs($path)
//{
$cmd = "/bin/ls -l " . $path . " | awk '{print $9}'";
exec($cmd,$output,$ret);
if($output)
{
$count = sizeof($output);
for($i=1;$i<$count;$i++)
{
$s = $output[$i];
$file=$path . $s;
echo "<br>";
//print ($file);
if (is_dir($file)) { $span = "<span style='color:blue' id='" . $s . "'>" . $file . "</span>"; }
else { $span = "<span style='color:black' id='" . $s . "'>" . $file . "</span>"; }
print ($chkbx_str);
print ($chkbx_str_1);
$chkbox = $chkbx_str . $s . $GLOBALS['chkbx_str_1'];
print $chkbox;
//$p = $span . $file . "</span>";
//$p = $s;
//print ($p);
print ($span);
}
}
else
{
print ("ERROR: Invalid Path!");
}
//}
list_fs($path);
print "</pre>";
?>