Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start()
- ?>
- <html>
- <head>
- <title>
- Login Form
- </title>
- <style>
- body {
- background-color: #c0c0c0;
- padding-top: 50px;
- padding-bottom: 50px;
- position: relative;
- }
- .container{
- border-radius: 5px;
- padding: 20px;
- text-align: center;
- }
- input[type=text] {
- box-shadow: 2px 2px #838789;
- opacity: 0.8;
- border-radius: 5px;
- width: 250px;
- height: 40px;
- border: 3px darkgrey;
- margin:auto;
- margin-bottom: 5px;
- display: inline-block;
- padding: 12px 20px;
- }
- input[type=password] {
- box-shadow: 2px 2px #838789;
- opacity: 0.8;
- border-radius: 5px;
- width: 250px;
- height: 40px;
- border: 3px darkgrey;
- margin:auto;
- margin-bottom: 20px;
- display: inline;
- padding: 12px 20px;
- }
- input[type=submit]:hover{
- }
- p{
- font-style: italic;
- font-family: Verdana;
- text-align: center;
- }
- form{
- margin: 0 auto;
- width:250px;
- }
- </style>
- </head>
- <body>
- <div>
- <?php
- $login = $_POST['login'];
- $username=$_POST['username'];
- $password=$_POST['password'];
- if(isset($login) && !empty($username) &&
- !empty($password))
- {
- if($username=='elena' && $password=='1234')
- { $_SESSION['valid']=true;
- echo 'You have entered a valid username and password';
- }
- else {
- echo 'Wrong username or password';
- }
- }
- ?>
- </div>
- <div class="container">
- <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>"
- method="post"; accept-charset="UTF-8">
- <p> Username:</p>
- <input type="text" align="center" name="username" maxlength="50" autofocus> <br/>
- <p>Password: </p>
- <input type="password" name="password" maxlength="50"><br/>
- <input type="submit" name="login" value="Submit" formtarget="_blank">
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement