Advertisement
Guest User

sda

a guest
Feb 4th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/htmL; charset=utf-8"/>
  4. </head>
  5.  
  6. <body>
  7. <?php
  8. $user = $_GET["korisnik"];
  9. $lozinka = $_GET["password"];
  10.  
  11. $servername = "localhost";
  12. $username = "root";
  13. $password = "";
  14. $database = "users";
  15.  
  16. $conn = mysqli_connect($servername, $username, $password, $database);
  17.  
  18. if (!$conn) {
  19. echo "Greska prilikom spajanja na dB!<br>";
  20. } else {
  21. echo "Spajanje na dB uspjesno!<br>";
  22. }
  23.  
  24. $sql = "SELECT * FROM korisnici WHERE Username='$user' and Password='$lozinka'";
  25.  
  26. $result = $conn->query($sql);
  27.  
  28. echo $result->num_rows;
  29.  
  30. while ($row = $result->fetch_assoc()) {
  31. echo "<a href='detail.php?id=".$row["ID"]."'>".$row["Name"]."</a>";
  32. }
  33.  
  34. $conn->close();
  35. ?>
  36. <hr>
  37. <h1> I. tehnicka skola TESLA </h1>
  38. <h2> Damjan Sudarevic / 3.A / C </h2>
  39. <hr>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement