Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Easistent | Log In</title>
- <link rel="stylesheet" href="css\login.css">
- </head>
- <body>
- <div class="header">
- <h1>Easistent</h1>
- </div>
- <div class="container">
- <form action="" method="post">
- <center>
- <input type="text" name="username" placeholder="Username">
- <input type="password" name="password" placeholder="Password">
- <input type="submit" name="submit" value="Prijavi se">
- <h3>Nimate še računa?</h3>
- <input class="register" type="submit" name="register" value="Registrirajte se">
- </center>
- </form>
- <?php
- $conn = mysqli_connect("localhost", "root", "", "r4b_mojaredovalnica");
- if (isset($_POST["submit"])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $result = mysqli_query($conn,
- "SELECT id_osebe FROM osebe WHERE uime = '$username' AND geslo = '$password'");
- if($result){
- echo "Uporabnik obstaja";
- header("Location: index.php");
- }
- else {
- echo "uporabnik ne obstaja";
- }
- }
- ?>
- </div>
- </body>
- </html>
- <?php
- if(isset($_POST["register"])){
- header("Location: register.php");
- }
- ?>
Add Comment
Please, Sign In to add comment