Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $msg = '';
- include 'include/connection.inc.php';
- if(isset($_POST['login'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- header("Location:dashboard.php");
- if(!$password || !$username) {
- $msg = "Username or password incorrect!";
- echo '<p class = "error">'.$msg.'</p>';
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <link type="text/css" rel="stylesheet" href="css/style.css" >
- <title>PHP&MySQL: Login | Zadaca 3</title>
- </head>
- <body>
- <div class="login-form">
- <div class="login-header">
- <h2 align="center">Login</h2>
- </div>
- <p class="error"<?php echo $msg; ?>></p>
- <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="POST">
- <div class="form-group">
- <label class="loginlabel">Username</label><input type="text" name="username" />
- </div>
- <div class="form-group">
- <label class="loginlabel">Password</label><input type="password" name="password" />
- </div>
- <div class="form-group>">
- <input type="submit" name="login" class="login-button" value="Login">
- </div>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement