Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1.    <?php
  2. $url = 'http://www.sitelab.combr.co/backup.rar';
  3.  
  4.  
  5. $ch = curl_init();
  6.  
  7. curl_setopt($ch, CURLOPT_URL, $url);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  10.  
  11. $fp = fopen('backup.rar', 'w');
  12.             curl_setopt($ch, CURLOPT_FILE, $fp);
  13.  
  14.  
  15. $result = curl_exec($ch);
  16. curl_close($ch);
  17. fclose($fp);
  18. if(!$result){
  19.                 echo 'False';
  20.                 exit;
  21.             }else{
  22.                 echo 'True';
  23.                 exit;
  24.             }
  25.  
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement