diff options
Diffstat (limited to 'www/list.php')
-rw-r--r-- | www/list.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/www/list.php b/www/list.php new file mode 100644 index 0000000..6dbeb40 --- /dev/null +++ b/www/list.php @@ -0,0 +1,17 @@ +<?php +require_once "vendor/autoload.php"; +use Rhilip\Bencode\TorrentFile; +use Rhilip\Bencode\ParseException; +if ($handle = opendir("..")) { + echo "<ul>"; + while (false !== ($entry = readdir($handle))) { + if (preg_match("/torrent$/", $entry)) { + $h = htmlspecialchars(explode(".", $entry)[0]); + echo '<li> <a href="info.php?h=' . $h . '">' . $h . '</a>'; + } + } + die(); + closedir($handle); +} else { + die("ne morem brati direktorija"); +} |