Advertisement
Akkarin909090

Untitled

Dec 10th, 2018
1,073
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. function onClick(arg){
  4. alert("Dziękujemy za Twój głos!");
  5. $.ajax({
  6. type: 'POST',
  7. contentType: text,
  8. url: 'data.php',
  9. data: {
  10. 'arg': arg,
  11. },
  12. success: function(response) {
  13. content.log(response);
  14. }
  15. });
  16.  
  17. }
  18. </script>
  19. <?php
  20. $servername = "xx";
  21. $username = "xx";
  22. $password = "xx";
  23. $name ="xx";
  24.  
  25. $conn = new mysqli($servername, $username, $password, $name);
  26.  
  27. $id = $_POST;
  28.  
  29. $sql = "UPDATE Buttons SET SUMA = SUMA + 1 WHERE ID = '$id'";
  30. $conn->query($sql);
  31.  
  32. $conn->close();
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement