fork download
  1. <?php
  2.  
  3. $ch = curl_init("http://w...content-available-to-author-only...e.com/");
  4. $fp = fopen("example_homepage.txt", "w");
  5.  
  6. curl_setopt($ch, CURLOPT_FILE, $fp);
  7. curl_setopt($ch, CURLOPT_HEADER, 0);
  8.  
  9. curl_exec($ch);
  10. if(curl_error($ch)) {
  11. fwrite($fp, curl_error($ch));
  12. }
  13. fclose($fp);
  14. ?>
Success #stdin #stdout #stderr 0.03s 26236KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  fopen(example_homepage.txt): failed to open stream: Permission denied in /home/U3cdzF/prog.php on line 4
PHP Warning:  curl_setopt(): supplied argument is not a valid File-Handle resource in /home/U3cdzF/prog.php on line 6
PHP Warning:  fwrite() expects parameter 1 to be resource, bool given in /home/U3cdzF/prog.php on line 11
PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /home/U3cdzF/prog.php on line 14