bin.shen
2016-12-05 a4c9331bbfe3e8765ccdc1c54cc6931bac49cc82
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
<?php
include_once "includes/header.php";
include_once "includes/navbar.php";
?>
<p>
Source Listing:
</p>
<ul>
  <?php
  chdir("../");
  $files = glob("*.php");
  $files = array_merge($files, glob("util/*.php"));
  foreach ($files as $fileName) {
    ?>
      <li><a href="package.php?view=<?php echo sha1($fileName);?>"><?php echo $fileName;?></a>&nbsp;-&nbsp;<?php echo date ("F d Y - g:i a", filemtime($fileName));?></li>
    <?php
  }
  ?>
</ul>
<?php
if( isset($_REQUEST['view']) ) {
    $hash = $_REQUEST['view'];
    $n = array_search($hash, array_map(sha1, $files));
    $fileName = $files[$n];
  ?>
  <hr />  
    Viewing: <?php echo $fileName;?>    
    <hr />
    <?php
    highlight_file($fileName);
    ?>
    <hr />
<?php
}
include_once "includes/footer.php";    
?>