Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $greshka = false;
- if(isset($_POST['submit'])){
- $username = $_POST['uname'];
- $password = $_POST['psw'];
- if($username == 'Ivan' && $password == '12345678'){
- $_SESSION['logged'] = $username;
- header('location: index.html');
- }else{
- $greshka = 'wrong username';
- }
- }
- ?>
- <form action="loginform.php" method="post">
- <div class="container">
- <label for="uname"><b>Username</b></label>
- <input type="text" placeholder="Enter Username" name="uname" required>
- <label for="psw"><b>Password</b></label>
- <input type="password" placeholder="Enter Password" name="psw" required>
- <button type="submit" id="submit" name="submit">Login</button>
- <label>
- <input type="checkbox" checked="checked" name="remember"> Remember me
- </label>
- </div>
- <div class="container" style="background-color:rgb(225, 225, 225)">
- <button type="button" class="cancelbtn">Cancel</button>
- <span class="psw">Forgot <a href="#">password?</a></span>
- </div>
- </form>
- <?php
- if($greshka){
- ?>
- <div>
- <h1><?= $greshka?></h1>
- </div>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment