Advertisement
Guest User

Untitled

a guest
Feb 4th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  4. </head>
  5. <body>
  6. <center>
  7. <h1>I. tehnička škola TESLA</h1><hr>
  8. <?php
  9. $id = $_GET["id"];
  10. $servername ="localhost";
  11. $username ="root";
  12. $password = "";
  13. $database = "baza";
  14. $conn = mysqli_connect($servername, $username, $password, $database);
  15. if (!$conn) {
  16. die("connection failed: ".mysqli_connect_error());
  17. }
  18. $sql ="SELECT * FROM tablica WHERE id='$id'";
  19. mysqli_query($conn, "SET NAMES 'utf8'");
  20. $result = $conn->query($sql);
  21. $name="";
  22. $username="";
  23. $lozinka="";
  24. $akcija="Update";
  25. while($row=$result->fetch_assoc())
  26. {
  27. $name=$row["Name"]
  28. $username=$row["User"];
  29. $lozinka=$row["pass"];
  30. }
  31. ?>
  32. <form name="forma" action="insert.php" method="get">
  33. <input type="text" name="id" value="<?php echo "$id";?>" />
  34. <input type="text" name="name" value="<?php echo "$id";?>" />
  35. <input type="text" name="pusername" value="<?php echo "$username";?>" />
  36. <input type="text" name="pass2 value="<?php echo "$lozinka";?>" />
  37. <input type="submit" value="Update">
  38. </form>
  39. </center>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement