Initial commit
This commit is contained in:
15
public/fetch.php
Executable file
15
public/fetch.php
Executable file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$directory = "./uploads/audited";
|
||||
$old_files = array_diff(scandir($directory), array('..', '.'));
|
||||
|
||||
$files=[];
|
||||
foreach($old_files as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
|
||||
if(empty($files)) {
|
||||
die();
|
||||
}
|
||||
|
||||
$random_index = rand(0, count($files)-1);
|
||||
echo("/uploads/audited/".$files[$random_index]);
|
||||
Reference in New Issue
Block a user