image.php 373 B

1234567891011121314151617
  1. <?php
  2. set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
  3. get_include_path());
  4. require_once "config.php";
  5. $url = base64_decode($_GET['url']);
  6. $filename = CACHE_DIR . '/images/' . sha1($url) . '.png';
  7. if (file_exists($filename)) {
  8. header("Content-type: image/png");
  9. echo file_get_contents($filename);
  10. } else {
  11. header("Location: $url");
  12. }
  13. ?>