Advertisement
janter13

Untitled

Sep 11th, 2014
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <?php
  2.  
  3. $host = 'localhost';
  4. $username = 'root';
  5. $password = 'passroot';
  6. $dbname = 'bot';
  7.  
  8. $connection = mysql_connect($host,$username,$password);
  9. if (!$connection) {
  10. die('Could not connect: ' . mysql_error());
  11. }
  12. mysql_select_db($dbname) or die(mysql_error());
  13. mysql_query('SET NAMES utf8');
  14. ?>
  15.  
  16. <form method="post">
  17. ID POST / FBID :<br>
  18. <input type="text" name="anu"><br>
  19. Limit :<br>
  20. <input type="text" name="limit"><br>
  21. <input type="submit" name="tusbol" value="Start Like">
  22. </form>
  23.  
  24. <?php
  25. if(isset($_POST['tusbol'])){
  26. $id = $_POST['anu'];
  27. $limit = $_POST['limit'];
  28.  
  29. $ho = mysql_query('select * from '.$dbname.' ORDER BY RAND() DESC LIMIT '.$limit);
  30. while($mo = mysql_fetch_array($ho)){
  31. $me = json_decode(file_get_contents('https://graph.facebook.com/me?&access_token='.$mo['access_token'];
  32.  
  33. $com = 'https://graph.facebook.com/'.$id.'/likes?method=post&access_token='.$mo['access_token'];
  34. $ren = file_get_contents($com);
  35.  
  36. echo '<span style='color:#3b5998'>'.$me[name].'</span> <span style='color:red'>[LIKED]</span>'.$id.'<hr/>';
  37. }
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement