Guest User

123

a guest
Jan 14th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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["name"];
  9. $lozinka=$_GET["pass"];
  10.  
  11. $servername="localhost";
  12. $username="root";
  13. $password="";
  14. $database="n_word";
  15.  
  16. $conn = mysqli_connect($servername, $username, $password, $database);
  17.  
  18. if (!$conn)
  19. {
  20. echo "Greska prilikom spajanja na dB!<br>";
  21. }
  22. else
  23. {
  24. echo "Spajanje na dB uspjesno!<br>";
  25. }
  26.  
  27. $sql = "SELECT * FROM korisnici WHERE Username='$user' and Pass='$lozinka'";
  28.  
  29. $result = $conn->query($sql);
  30.  
  31. echo $result->num_rows;
  32.  
  33. while ($row = $result->fetch_assoc())
  34. {
  35. echo "<a href='detail.php?id=".$row["ID"]."'>".$row["Name"]."</a>";
  36. }
  37.  
  38. $conn->close();
  39.  
  40. ?>
  41.  
  42. <hr>
  43. <h1> I. tehnicka skola TESLA </h1>
  44. <h2> Damjan Sudarevic </h2>
  45. <h2> 3.A / C </h2>
  46. <hr>
  47. </body>
  48. </html>
Add Comment
Please, Sign In to add comment