SHARE
TWEET

Untitled

a guest Jun 20th, 2012 320,104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
Top