View Single Post
Old 2007-12-20, 01:41 PM   #3
guschi2k
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
 
guschi2k's Avatar
 
Join Date: Oct 2003
Location: right here
Posts: 75
Send a message via ICQ to guschi2k
Thanks for your answer Unfortunately it's not working for me, b/c as far as I know getimagesize() cannot bypass hotlinking

I tried it with this image:
http://www.shizzn.com/x/stuff/open/cimg3621.jpg - no hotlink protection
http://www.shizzn.com/x/stuff/prot/cimg3621.jpg - htaccess hotlink protection


I know tried it like that:
Code:
$target_host = "www.shizzn.com";
$target_path = "/x/stuff/prot/cimg3621.jpg";

#header("Content-Type: text/plain");
header("Content-Type: image/jpeg");
    $fp = fsockopen("$target_host", 80, $errno, $errstr, 5);
    if(!$fp){echo "$errstr ($errno)<br>\n";}
    else
      {
      $out = "GET ". $target_path ." HTTP/1.1\r\n";
      $out .= "Host: ". $target_host ."\r\n";
      $out .= "Referer: http://". $target_host ."\r\n";
      $out .= "User-Agent: Blabla Browser Name(xyz)\r\n";
      $out .= "Keep-Alive: 200\r\n";
      $out .= "Connection: Close\r\n\r\n";

      fwrite($fp, $out);
      while (!feof($fp))
        {
        $status_request = fgets($fp, 500000);
        echo  $status_request;
        $file = fopen("temp_img.jpg","w+");
        fwrite($file,$status_request);
        fclose($file);
        }
      fclose($fp);
      }
but somehow it's just not working I'm no PHP expert, though I've been messing with it for years *lol ... if I could ... at least find out a way how to save the image to my server and then do a getimagesize() on the local file?

I just really s*ck! when it comes to file operations *lol If only a head request would also give info about the dimensions I'm using the head request to check the status (redirection, 404 etc) and the image size in bytes, which works perfectly fine
__________________
Tonys XXX Links wants your quality free sites|king|
Pleeeaaase help & save my addiction SaveEnterprise

Last edited by guschi2k; 2007-12-20 at 01:50 PM..
guschi2k is offline   Reply With Quote