Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. $url = $_GET['ur'];
  3. header('Content-Type: image/jpeg');
  4. header('Content-Type: image/png');
  5. header('Content-Type: image/gif');
  6.  
  7. if($file != ''){
  8. $cache_expire = 60*60*24*365;
  9. header("Pragma: public");
  10. header("Cache-Control: maxage=". $cache_expire);
  11. header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cache_expire).' GMT');
  12.  
  13. //The cURL stuff...
  14. $ch = curl_init();
  15. curl_setopt($ch, CURLOPT_URL, $url);
  16. curl_setopt($ch, CURLOPT_HEADER, 0);
  17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  18. curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
  19. $picture = curl_exec($ch);
  20. curl_close($ch);
  21. //Display the image in the browser
  22.  
  23. echo $picture;
  24.  
  25. }
  26. exit;
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement