Page 1 of 1

Posted: Sun Nov 24, 2002 3:47 am
by Oleg Butuzov
http://php.spb.ru

Code: Select all

<?
     
     $so = fsockopen("php.spb.ru", 80, &$errno, &$errstr, 30);
     fputs($so,"GET /files/notepad.exe HTTP/1.0\nHOST: php.spb.ru\n\n");

     while(fgets($so,2048)!="\r\n" && !feof($so));
   
     unset($buf);
     while(!feof($so)) $buf.=fread($so,2048);
 
      fclose($so);
      echo "Download fine, size ".strlen($buf)." bytes."; flush();

     $f=fopen("download.tmp","wb+");
     fwrite($f,$buf,strlen($buf));
     fclose($f);
   
?>