Advertisement
Guest User

Pintaaarr

a guest
Dec 3rd, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. </head>
  5.  
  6. <body>
  7. <center>
  8. <h1> I. tehnicka skola TESLA </h1><hr>
  9. <?php
  10. $id = $_GET["id"];
  11.  
  12. $servername = "localhost";
  13. $username = "root";
  14. $password = "";
  15. $database = "korisnici";
  16.  
  17. $conn = mysqli_connect($servername, $username, $password, $database);
  18.  
  19. if (!$conn) {
  20. die("Connection failed: " . mysqli_connect_error());
  21. }
  22.  
  23. $sql = "SELECT * FROM korisnici WHERE id='$id'";
  24.  
  25. mysqli_query($conn, "SET NAMES 'utf8'");
  26.  
  27. $result = $conn->query($sql);
  28.  
  29. $name="";
  30. $username="";
  31. $lozinka="";
  32. $akcija="Update";
  33.  
  34. while ($row = $result->fetch_assoc()) {
  35. $name = $row["Name"];
  36. $username = $row["Username"];
  37. $lozinka = $row["Pass"];
  38. }
  39. ?>
  40.  
  41. <form name="forma" action="insert.php" method="get">
  42. <input type="text" name="id" value="<?php echo "$id";?>" /> <br>
  43. <input type="text" name="name" value="<?php echo "$name";?>" /> <br>
  44. <input type="text" name="username" value="<?php echo "$username";?>" /> <br>
  45. <input type="text" name="pass" value="<?php echo "$lozinka";?>" /> <br>
  46. <input type="submit" value="Update">
  47. </center>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement