tiger.php 627 B

123456789101112131415161718
  1. <?php
  2. if ($_GET['t']=='png') { $filename = 'tiger.png'; $mime = 'png'; }
  3. else if ($_GET['t']=='gif') { $filename = 'tiger.gif'; $mime = 'gif'; }
  4. else if ($_GET['t']=='jpg') { $filename = 'tiger.jpg'; $mime = 'jpeg'; }
  5. else if ($_GET['t']=='jpeg') { $filename = 'tiger.jpg'; $mime = 'jpeg'; }
  6. else if ($_GET['t']=='wmf') { $filename = 'tiger2.wmf'; $mime = 'wmf'; }
  7. else if ($_GET['t']=='svg') { $filename = 'tiger.svg'; $mime = 'svg'; }
  8. else { exit; }
  9. $fp = fopen($filename, 'rb');
  10. header("Content-Type: image/".$mime);
  11. header("Content-Length: " . filesize($filename));
  12. fpassthru($fp);
  13. fclose($fp);
  14. exit;
  15. ?>