1234567891011121314151617181920212223 |
- <?
- header('Content-Type: application/json');
- include "functions.php";
- $activeid = $_REQUEST['id'];
- $hostpath = $_SERVER['SERVER_NAME'];
- $imgpath = GetVideoPathFromTasktype($activeid);
- $files1 = scandir($imgpath);
- $filearray = array();
- if (sizeof($files1) > 2)
- {
- foreach ($files1 as $file )
- {
- $x = pathinfo($file)['extension'];
- if($file === '.' || $file === '..') {continue;}
- if ($x == 'mp4' || $x == 'jpg' || $x == 'jpeg' || $x == 'pdf') {
- array_push($filearray, "http://$hostpath/$imgpath$file");
- }
- }
- $json = json_encode($filearray);
- echo $json;
- // var_dump($json);
- }
|