notes app created with files backend
This commit is contained in:
parent
7755aa53f7
commit
9d716fd449
9 changed files with 85 additions and 14 deletions
20
local/media/get.php
Normal file
20
local/media/get.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
$_title = "Media viewer";
|
||||
$root = $_SERVER["DOCUMENT_ROOT"];
|
||||
require "$root/templates/header.php";
|
||||
|
||||
$urls_base = __DIR__ . "/urls";
|
||||
if (isset($_GET["list"])) {
|
||||
$file = "$urls_base/" . $_GET["list"];
|
||||
$urls = json_decode(file_get_contents($file));
|
||||
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'>Try $list</a><br>";
|
||||
}
|
||||
}
|
||||
|
||||
require "$root/templates/footer.php";
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue