Advertisement
Guest User

Untitled

a guest
May 8th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 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.  
  6. $servername = "localhost";
  7. $username = "root";
  8. $password = "";
  9. $database = "Korisnici";
  10.  
  11. $conn = mysqli_connect($servername, $username, $password, $database);
  12.  
  13. if(!$conn)
  14. {
  15. die("Greška prilikom spajanja<br>: " . mysqli_connect_error());
  16. }
  17.  
  18. $sql = "SELECT * FROM Korisnici WHERE ID='$ID'";
  19. $result = $conn->query($sql);
  20.  
  21. $ime="";
  22. $prezime="";
  23. $user="";
  24. $adresa="";
  25. $email="";
  26. $pass="";
  27. $akcija="";
  28. while($row = $result->fetch_assoc())
  29. {
  30. $ime=$row["Ime"];
  31. $prezime=$row["Prezime"];
  32. $user=$row["User"];
  33. $adresa=$row["Adresa"];
  34. $email=$row["Email"];
  35. $pass=$row["Password"];
  36. }
  37. ?>
  38. <form name="forma" action="insert.php" method="get">
  39. <input type="text" name="id" value=<?php echo "$ID";?>" />
  40. <input type="text" name="ime" value=<?php echo "$ime";?>" />
  41. <input type="text" name="prezime" value=<?php echo "$prezime";?>" />
  42. <input type="text" name="username" value=<?php echo "$user";?>" />
  43. <input type="text" name="adresa" value=<?php echo "$adresa";?>" />
  44. <input type="text" name="email" value=<?php echo "$email";?>" />
  45. <input type="text" name="pass" value=<?php echo "$pass";?>" />
  46. <input type="submit" value="Update">
  47. </form>
  48. </center>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement