blob: 6dbeb40ef4c655068c3867580d6a1e318671fd18 (
plain) (
tree)
|
|
<?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");
}
|