Posted By

saturngod on 03/17/10


Tagged

file check crossdomain


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrianCoyDesign


Cross domain file check


 / Published in: PHP
 

  1. $imgfile="http://www.crossdomain.com/image.jpg";
  2. try
  3. {
  4. $k=@file_get_contents($imgfile);
  5.  
  6. } catch (Exception $e) {
  7. $k=false;
  8. }
  9.  
  10. if($k!=false)
  11. {
  12. $result .= "<img src='$imgfile'>";
  13.  
  14. }
  15. else
  16. {
  17. $result.="no image file";
  18. }

Report this snippet  

You need to login to post a comment.