password - no echo, media - redirect
This commit is contained in:
parent
7755aa53f7
commit
88d7cb4f69
5 changed files with 16 additions and 11 deletions
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
$title = "Media manager";
|
||||
$title = "Media viewer";
|
||||
$root = $_SERVER["DOCUMENT_ROOT"];
|
||||
require "$root/templates/header.php";
|
||||
|
||||
$urls_base = __DIR__ . "/../urls";
|
||||
$urls_base = __DIR__ . "/urls";
|
||||
if (isset($_GET["list"])) {
|
||||
$file = "$urls_base/" . $_GET["list"];
|
||||
$urls = json_decode(file_get_contents($file));
|
||||
$url = $urls[array_rand($urls)];
|
||||
echo "<a href='$url'>Watch</a><br>";
|
||||
header("Location: " . $urls[array_rand($urls)]);
|
||||
} else {
|
||||
foreach (scandir($urls_base) as $list) {
|
||||
if ($list === '.' || $list === '..')
|
||||
continue;
|
||||
echo "<a href='" . $_SERVER['PHP_SELF'] . "?list=$list'>List $list</a><br>";
|
||||
echo "<a href='" . $_SERVER['PHP_SELF'] . "?list=$list'>Try $list</a><br>";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue