Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors',1);
  3. error_reporting(E_ALL);
  4. $host="localhost";
  5. $user="lidertvru_bot";
  6. $pass="romich0305";
  7. $db_name="lidertvru_bot";
  8. $link=mysql_connect($host,$user,$pass);
  9. mysql_select_db($db_name,$link);
  10.  
  11. $query = mysql_query ("SELECT id
  12. FROM livekharkov ");
  13. $myrow_query = mysql_fetch_array ($query);
  14.  
  15. while ($myrow_query = mysql_fetch_array ($query)):
  16.  
  17. //Токен сообщества
  18. $token = '7d8aad285478e800ed4a094161cc4f96f8be92e3403f725c9db281da7ab48ee12fa6d864d45c390be90ef';
  19.  
  20. $request_params = array(
  21. 'message' => $_POST['letter'],
  22. 'user_id' => $myrow_query['id'],
  23. 'access_token' => $token,
  24. 'v' => '5.0'
  25. );
  26.  
  27. $get_params = http_build_query($request_params);
  28.  
  29. file_get_contents('https://api.vk.com/method/messages.send?'. $get_params);
  30.  
  31. echo file_get_contents('https://api.vk.com/method/messages.send?'. $get_params);
  32.  
  33. endwhile;
  34.  
  35. header('Location: http://skotch.ml/bot/delivery/success.php');
  36. exit;
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement