Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
  2. <?php
  3.  
  4. $id = $_GET["ID"];
  5. $user = $_GET["Username"];
  6. $lozinka = $_GET["Pass"];
  7.  
  8. $servername = "localhost";
  9. $username = "root";
  10. $password = "";
  11. $database = "baza";
  12.  
  13. $conn = mysqli_connect($servername, $username, $password, $database);
  14.  
  15. if (!$conn)
  16. {
  17. echo "Greška prilikom spajanja na dB!<br>";
  18. }
  19. else
  20. {
  21. echo "Spajanje na dB uspješno!<br>";
  22. }
  23.  
  24. $sql = "UPDATE korisnici SET Username='$user', Pass='$lozinka' WHERE ID='$id'";
  25. mysqli_query($conn, "SET NAMES 'utf8'");
  26.  
  27.  
  28. if ($conn->query($sql) === TRUE) {
  29. echo "Record updated successfully";
  30. } else {
  31. echo "Error updating record: " . $conn->error;
  32. }
  33.  
  34. $conn->close();
  35.  
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement