decode('../inventory/shop.json'); $iv = array(); $i = 0; foreach($product_list as $c) { array_push($iv,$c); if($iv[$i]['product.id'] == $id) { if($iv[$i]['product.status'] == '1') { $video = $shop->cleaninput($iv[$i]['product.video']); $audio = $shop->cleaninput($iv[$i]['product.audio']); if(isset($video) && ($video != "") && ($_GET['type'] == 'video')) { $file = $video; } if(isset($audio) && ($audio != "") && ($_GET['type'] == 'audio')) { $file = $audio; } } break; } $i++; } if(isset($_GET['type'])) { switch($_GET['type']) { case 'audio': header('Content-Type: audio/mpeg'); break; case 'video': header('Content-Type: video/mp4'); break; default: exit; } } else { echo 'A stream id was not given, aborting code execution.'; exit; } unset($_SESSION['streamtoken']); $_SESSION['streamtoken'] = null; readfile($file); ?>