Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
  2. <center>
  3. <H1>I. tehnička škola TESLA</h1><hr>
  4. <?php
  5.  
  6. $id = $_GET["id"];
  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. die("Greška prilikom spajanja na dB: " . mysqli_connect_error());
  18. }
  19.  
  20. $sql = "SELECT * FROM korisnici WHERE ID='$id'";
  21. mysqli_query($conn, "SET NAMES'utf8'");
  22. $result = $conn->query($sql);
  23.  
  24. $name="";
  25. $username="";
  26. $lozinka="";
  27. $akcija="Update";
  28. while($row = $result->fetch_assoc())
  29. {
  30. $name=$row["Name"];
  31. $username=$row["Username"];
  32. $lozinka=$row["Pass"];
  33. }
  34.  
  35. ?>
  36.  
  37. <form name="forma" action="insert.php" method="get">
  38. <input type="text" name="ID" value="<?php echo "$id";?>" />
  39. <input type="text" name="Name" value="<?php echo "$name";?>" />
  40. <input type="text" name="Username" value="<?php echo "$username";?>" />
  41. <input type="text" name="Pass" value="<?php echo "$lozinka";?>" />
  42. <input type="submit" value="Update">
  43. </form>
  44. </center>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement