15 lines
296 B
PHP
15 lines
296 B
PHP
|
<?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]);
|