Advertisement
gabrielaozegovic

matej_index

Dec 11th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <?php
  2. include 'baza.php';
  3. db_connect();
  4. ?>
  5.  
  6. <html>
  7. <form action="" method="post" >
  8. <input type="text" name="email1">
  9. <input type="password" name="pass1">
  10. <input type="submit" name="putac">
  11. </form>
  12.  
  13. <body>
  14. <table border=1>
  15. <tr><th>Email</th><th>Ime</th><th>Prezime</th><th>Lozinka</th></tr>
  16. <?php
  17. $myemail = $_POST["email1"];
  18. $mypass = $_POST["pass1"];
  19. $result = db_query("SELECT * FROM korisnik WHERE email='$myemail' AND lozinka='$mypass'");
  20.  
  21. if ($result == false)
  22. {
  23. die("Error: "); // Handle failure - log the error, notify administrator, etc.
  24. }
  25.  
  26. while ($row = mysqli_fetch_assoc($result))
  27. {
  28. echo "<tr>";
  29. echo "<td>{$row['email']}</td>";
  30. echo "<td>{$row['ime']}</td>";
  31. echo "<td>{$row['prezime']}</td>";
  32. echo "<td>{$row['lozinka']}</td>";
  33. echo "</tr>";
  34. }
  35. ?>
  36. </table>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement