Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(isset($_SESSION["admin"])){
- header("Location: admin.php");
- }
- if(isset($_POST["submit"])){
- if(empty($_POST["username"])){
- echo 'Username required';
- }
- if(empty($_POST["password"])){
- echo 'Password required';
- }
- $username = $_POST["username"];
- $password = $_POST["password"];
- if(file_exists("users/".$username.".txt")){
- $file = "users/". $username .".txt";
- $password = 'password';
- } else {
- echo 'You are not the admin of this site';
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>BukkitPE Login Page</title>
- <style type="text/css">
- a{
- text-decoration:none;
- }
- </style>
- </head>
- <body>
- <nav><font size="3"><a href="index.php">Home</a></font></nav><br><br>
- <fieldset style="width:30%"><legend>Login</legend>
- <form action="login.php" method="post">
- <label for="username">Name:</label><br>
- <input type="text" name="username" /><br>
- <label for="password">Password:</label><br>
- <input type="password" name="password" /><br>
- <input type="submit" value="Submit" name="submit"/>
- </form>
- </fieldset>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement