Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function login($username, $password) {
- if($username == "Admin" && $password == "p4ssM3") {
- return true;
- }
- else {
- return false;
- }
- }
- if (isset($_POST['username']) && isset($_POST['password']) {
- $login = login($_POST['username'], $_POST['password']);
- }
- else {
- $login = false;
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Login</title>
- </head>
- <body style="background:url('login.jpg');color:white;">
- <?php
- if ($login == true) {
- ?>
- <h1 style="text-align:left;font-weight:bold;test-decoration:underline;">Panel</h1>
- <p>
- <h3>Username: <?= $_POST['username']; ?></h3>
- </p>
- <?php
- }
- else {
- ?>
- <h1 style="text-align:left;font-weight:bold;test-decoration:underline;">Login</h1>
- <form method="post">
- <input type="text" name="username" />
- <input type="password" name="password" />
- <p>
- <input type="submit" value="Log In" />
- </p>
- </form>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement