Guest User

Code

a guest
Aug 24th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <?php
  2.  
  3. $access_token = "tokenmu";
  4. $url = "https://graph.facebook.com/me/feed?method=POST";
  5.  
  6. if(!empty($_GET['link']) && !empty($_GET['img'])){
  7. $link = $_GET['link'];
  8. $img = $_GET['img'];
  9. $cek = fopen("berita.txt",'r');
  10. $str = fgets($cek);
  11. fclose($cek);
  12. }
  13. $ch = curl_init();
  14. $attachment = array( 'access_token' => $access_token,
  15. 'link' => $link,
  16. 'picture' => $img,
  17. 'message' => 'Tukang Koran Facebook',
  18. 'name' => '',
  19. 'description' => '',
  20. 'from' => '',
  21. 'created_time' => '',
  22. );
  23.  
  24. curl_setopt($ch, CURLOPT_URL,$url);
  25. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  26. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  27. curl_setopt($ch, CURLOPT_POST, true);
  28. curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
  29. $result= curl_exec($ch);
  30.  
  31. curl_close ($ch);
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment