Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = "root";
- $pass = "password";
- $error = "<div class='alert red'>Your login credentials are incorrect!</div>Your login credentials are incorrect!";
- $success = "<div class='alert green'>You have been successfully logged in!";
- ?>
- <html>
- <head>
- <style>
- .container {
- width: 75%;
- height: 100px;
- margin: auto;
- position: fixed;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- }
- .wrapper {
- width: auto;
- height: auto;
- padding: 20px;
- background-color: rgba(0, 0, 0, .75);
- border: 1px solid #FFF;
- color: #FFF;
- }
- input[type="text"],
- input[type="password"] {
- outline: none;
- border: 1px solid #FFF;
- background-color: rgba(255, 255, 255, .1);
- padding: 5px;
- font-size: 16px;
- color: #FFF;
- }
- input[type="submit"] {
- background-color: rgb(0, 0, 0);
- border: 1px solid #FFF;
- color: #FFF;
- padding: 6px 10px;
- outline: 0;
- opacity: .7;
- margin-left: 10px;
- transition: all .3s ease;
- }
- input[type="submit"]:hover {
- opacity: 1;
- cursor: pointer;
- transition: all .3s ease;
- }
- input:-webkit-autofill,
- input:-webkit-autofill:hover,
- input:-webkit-autofill:focus {
- border: 1px solid rgba(255, 255, 0, .5);
- -webkit-text-fill-color: white;
- -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 0, .1) inset;
- transition: background-color 5000s ease-in-out 0s;
- }
- .u {
- font-size: 18px;
- padding-right: 5px;
- }
- .alert {
- padding: 8px;
- border: 1px solid rgba(0, 0, 0, .3);
- width: 50%;
- margin: auto;
- margin-top: 20px;
- }
- .green {
- background-color: rgba(0, 165, 135, .6);
- }
- .red {
- background-color: rgba(200, 50, 50, .6);
- }
- form {
- margin: 0 !important;
- }
- </style>
- </head>
- <body style="background: #000 url(https://i.imgur.com/i6UT7ND.jpg) no-repeat bottom center fixed; font-family: sans-serif;">
- <?php
- session_start();
- if(!isset($_SESSION["username"])){
- if(isset($_POST["password"]) && isset($_POST["username"])){
- $username = $_POST["username"];
- $password = $_POST["password"];
- }
- ?>
- <div class="container">
- <div class="wrapper">
- <center>
- <form method="post">
- <span class="u"> Username</span>
- <input type="text" name="username" method="post" style="margin-right: 20px;">
- <span class="u"> Password</span>
- <input type="password" name="password" method="post">
- <input type = "submit" value = "Login">
- </form>
- <?php
- }
- ?>
- <?php
- if(isset($username) && isset($password)){
- if($username == $user && $password == $pass) {
- echo $success;
- } else if ($username != $user && $password == $pass) {
- echo $error;
- } else if ($password != $user && $username == $pass) {
- echo $error;
- } else if ($username != $user && $password != $pass) {
- echo $error;
- }
- }
- ?>
- </center>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement