staticjunkcode.php 650 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. session_start();
  3. include('logo.html');
  4. include('menulist.html');
  5. include('static-configuration');
  6. ?>
  7. <div class='content'>
  8. <h1> Contents of CCAN <?=$argv[1]?> </h1>
  9. <p>
  10. <table align="center" width="80%" border="0" cellpadding="3" cellspacing="1">
  11. <?php
  12. $d = dir($argv[1]);
  13. $files = array();
  14. while (false !== ($entry = $d->read())) {
  15. if ($entry[0] != '.') {
  16. array_push($files, $entry);
  17. }
  18. }
  19. $d->close();
  20. sort($files);
  21. foreach ($files as $file) {
  22. $size = round((filesize($argv[1]."/".$file) + 1023) / 1024);
  23. ?>
  24. <tr>
  25. <td><a href="<?=$argv[2]."/".$file?>"><?=$file?> (<?=$size?>K)</td>
  26. </tr>
  27. <?php
  28. }
  29. ?>
  30. </table>
  31. </div>
  32. </body></html>