Guest User

GaŁči - loginPage.php

a guest
Apr 16th, 2018
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html lang="en">
  4.  
  5. <head>
  6.  
  7. <meta charset="UTF-8">
  8.  
  9. <title>Easistent | Log In</title>
  10.  
  11. <link rel="stylesheet" href="css\login.css">
  12.  
  13. </head>
  14.  
  15. <body>
  16.  
  17.  
  18. <div class="header">
  19. <h1>Easistent</h1>
  20. </div>
  21.  
  22.  
  23. <div class="container">
  24.  
  25. <form action="" method="post">
  26. <center>
  27. <input type="text" name="username" placeholder="Username">
  28. <input type="password" name="password" placeholder="Password">
  29. <input type="submit" name="submit" value="Prijavi se">
  30. <h3>Nimate še računa?</h3>
  31. <input class="register" type="submit" name="register" value="Registrirajte se">
  32.  
  33. </center>
  34.  
  35. </form>
  36.  
  37. <?php
  38.  
  39. $conn = mysqli_connect("localhost", "root", "", "r4b_mojaredovalnica");
  40.  
  41. if (isset($_POST["submit"])) {
  42. $username = $_POST['username'];
  43. $password = $_POST['password'];
  44.  
  45.  
  46. $result = mysqli_query($conn,
  47. "SELECT id_osebe FROM osebe WHERE uime = '$username' AND geslo = '$password'");
  48.  
  49. if($result){
  50. echo "Uporabnik obstaja";
  51. header("Location: index.php");
  52. }
  53. else {
  54. echo "uporabnik ne obstaja";
  55. }
  56. }
  57.  
  58. ?>
  59.  
  60. </div>
  61.  
  62.  
  63. </body>
  64.  
  65. </html>
  66.  
  67.  
  68. <?php
  69.  
  70.  
  71.  
  72. if(isset($_POST["register"])){
  73.  
  74. header("Location: register.php");
  75. }
  76.  
  77.  
  78.  
  79. ?>
Add Comment
Please, Sign In to add comment