Share-Links.biz API function


/ Published in: PHP
Save to your folder(s)

API function in php for share-links.biz


Copy this code and paste it in your HTML
  1. function shareLinksBizFolder($foldername, $och_links)
  2. {
  3. global $apikey_sharelinks;
  4. $links = array(
  5. $och_links
  6. );
  7.  
  8. // POST DATA
  9.  
  10. $postdata = array(
  11. 'apikey' => $apikey_sharelinks,
  12. 'folderName' => $foldername,
  13. 'captcha' => '1',
  14. 'c_web' => '1',
  15. 'c_dlc' => '1',
  16. 'c_cnl' => '1',
  17. 'c_ccf' => '1',
  18. 'c_rsdf' => '1',
  19. 'links' => implode("\n", $links)
  20. );
  21.  
  22. // INITIALISE CURL REQUEST
  23.  
  24. $ch = curl_init('http://share-links.biz/api/insert');
  25.  
  26. // CURL OPTIONS
  27.  
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  29. curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  30.  
  31. // EXECUTE CURL REQUEST
  32.  
  33. $result = curl_exec($ch);
  34. list($share_links) = explode("\n", $result);
  35. curl_close($ch);
  36. return $share_links;
  37. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.