Advertisement
RieqyNS13

Untitled

Jun 26th, 2015
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.65 KB | None | 0 0
  1. <?php
  2. function curl($url, $post=null){
  3.  $ch = curl_init();
  4.  curl_setopt($ch, CURLOPT_URL, $url);
  5.  if($post!=null){
  6.   curl_setopt($ch, CURLOPT_POST, true);
  7.   curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  8.  }
  9.  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  10.  curl_setopt($ch, CURLOPT_HEADER, true);
  11.  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0");
  12.  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  13.  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  14.  curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
  15.  curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
  16.  //curl_setopt($ch, CURLOPT_VERBOSE, true);
  17.  $exec = curl_exec($ch);
  18.  return $exec;
  19.  curl_close($ch);
  20. }
  21.  
  22. include 'koneksi.php';
  23. $result = mysql_query("SELECT * FROM auto");
  24. if($result){
  25. while($row = mysql_fetch_array($result))
  26.   {
  27. $ide = $row[id];
  28. $access_token = $row[accesstoken];
  29. $id = $row[grup];
  30. $text = $row[kalimat];
  31. $user = $row[idmu];
  32. $pass = $row[pwmu];
  33. $data = "email=".$user."&pass=".$pass."&login=Masuk";
  34. $asu = curl("https://m.facebook.com/login.php", $data);
  35. $asu = curl("https://www.facebook.com/dialog/oauth?response_type=token&display=popup&client_id=145634995501895&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer%2Fcallback&scope=user_actions.books%2Cuser_actions.music%2Cuser_actions.video%2Cuser_checkins%2Cuser_education_history%2Cuser_events%2Cuser_games_activity%2Cuser_groups%2Cuser_hometown%2Cuser_interests%2Cuser_likes%2Cuser_location%2Cuser_notes%2Cuser_photo_video_tags%2Cuser_photos%2Cuser_questions%2Cuser_relationship_details%2Cuser_relationships%2Cuser_religion_politics%2Cuser_status%2Cuser_subscriptions%2Cuser_videos%2Cuser_website%2Cuser_work_history%2Cfriends_about_me%2Cfriends_actions.books%2Cfriends_actions.music%2Cfriends_actions.news%2Cfriends_actions.video%2Cfriends_activities%2Cfriends_birthday%2Cfriends_checkins%2Cfriends_education_history%2Cfriends_events%2Cfriends_games_activity%2Cfriends_groups%2Cfriends_hometown%2Cfriends_interests%2Cfriends_likes%2Cfriends_location%2Cfriends_notes%2Cfriends_photo_video_tags%2Cfriends_photos%2Cfriends_questions%2Cfriends_relationship_details%2Cfriends_relationships%2Cfriends_religion_politics%2Cfriends_status%2Cfriends_subscriptions%2Cfriends_videos%2Cfriends_website%2Cfriends_work_history%2Cads_read%2Cemail%2Cpublish_checkins");
  36. if(file_exists("cookie.txt"))unlink("cookie.txt");
  37. $gay = preg_match("/access_token=(.*?)&expires_in/i", $asu, $m);
  38. $query = "UPDATE auto SET accesstoken = '$m[1]' WHERE id = '$ide'";
  39.  $hasil = mysql_query($query);
  40.  //see the result
  41.  if ($hasil) {
  42.     echo "<h4> update data success</h4>";
  43. }
  44. echo $m[1];
  45. }
  46. }
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement