Advertisement
Guest User

Untitled

a guest
Oct 19th, 2012
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2.  
  3.     if (!empty($_GET['value'])) {
  4.  
  5.         include_once('./functions.php');
  6.  
  7.         $track = 'audio/'.basename(getFileNameFromHash($_GET['value']));
  8.  
  9.         if (file_exists($track)) {
  10.             header("Content-Type: audio/mpeg");
  11.             header('Content-Length: ' . filesize($track));
  12.             header('Content-Disposition: inline; filename=' . $track);
  13.             header('X-Pad: avoid browser bug');
  14.             header('Cache-Control: no-cache');
  15.             readfile($track);
  16.         } else {
  17.             header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
  18.             echo "no file";
  19.         }
  20.  
  21.         exit;
  22.  
  23.     }
  24.  
  25. ?>
  26. <audio src="/play.php?value=d41d8cd98f00b204e9800998ecf8427e" autoplay loop controls></audio>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement