-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.php
More file actions
71 lines (71 loc) · 2.53 KB
/
Copy pathindex.php
File metadata and controls
71 lines (71 loc) · 2.53 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
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php header('Content-Type: text/html; charset=utf-8'); ?>
<html>
<head>
<title><?php echo getcwd(); ?></title>
<style type='text/css'>
body{
font-family: "Candara", sans-serif;
font-size: 9pt;
line-height: 10.5pt;
}
div.pic{
display: block;
float: left;
background-color: white;
border: 1px solid #ccc;
padding: 2px;
text-align: center;
margin: 2px 10px 10px 2px;
}
</style>
</head>
<body>
<h2><a name="plots"><?php echo getcwd(); ?></a></h2>
<div>
<p><form>Filter: <input type="text" name="match" size="30" value="" /><input type="Submit" value="Go" /></form></p>
<?php
$remainderFiles = array();
$remainderFolders = array();
if ($_GET['noplots']){
print "Plots will not be displayed.\n";
}
else{
foreach(glob("*") as $filename){
if(!preg_match('/.*\.png$/', $filename)){
if(is_dir($filename)){
array_push($remainderFolders, $filename);
}
else if(!preg_match('/.*\.php.*$/', $filename)){
array_push($remainderFiles, $filename);
}
continue;
}
if (isset($_GET['match']) && !preg_match('/'.$_GET['match'].'/', $filename)) continue;
print "<div class='pic'>\n";
print "<h3><a href=\"$filename\">$filename</a></h3>";
print "<a href=\"$filename\"><img src=\"$filename\" style=\"border: none; width: 300px; \"></a>";
print "</div>";
}
}
?>
</div>
<div style="display: block; clear:both;">
<h2><a name="files"> <P>Files</a></h2>
<ul>
<?
foreach ($remainderFiles as $filename) {
print "<li><a href=\"$filename\">$filename</a></li>";
}
?>
</ul>
<h2><a name="folders"> <P>Folders</a></h2>
<ul>
<?
foreach ($remainderFolders as $filename) {
print "<li><a href=\"$filename\">$filename</a></li>";
}
?>
</ul>
</div>
</body>
</html>