Advertisement
Guest User

Untitled

a guest
Jun 20th, 2012
332,714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. $foldername = 'your_foldername';
  4. $links = array(
  5.     'your_link_1',
  6.     'your_link_2'
  7. );
  8.  
  9.  
  10.  
  11. function curl_request($url, $postdata) {
  12.    
  13.     // INITIALISE CURL REQUEST
  14.     $ch = curl_init($url);
  15.    
  16.     // CURL OPTIONS
  17.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  18.     curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  19.    
  20.     // EXECUTE CURL REQUEST
  21.     $result = curl_exec($ch);
  22.    
  23.     curl_close($ch);
  24.     return $result;
  25. }
  26.  
  27.  
  28. // POST DATA
  29. $postdata = array(
  30.     'foldername' => $foldername,
  31.     'links' => implode("\n", $links)
  32. );
  33.  
  34.  
  35. $curl_result = curl_request('http://ncrypt.in/api.php', $postdata);
  36. list($folder, $status) = explode("\n", $curl_result);
  37.  
  38. echo "Folderlink: ".$folder."<br />\n";
  39. echo "Statuslink: ".$status."<br />\n";
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement