Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'includes/config.php';
- if(isset($_POST['username']) && isset($_POST['password'])){
- $username = sec($_POST['username']);
- $password = sec($_POST['password']);
- $ban = get_row("SELECT ID FROM bans WHERE Name='$username'");
- $check = get_row("SELECT ID, Name FROM players WHERE Name='$username' OR AName='$username' && Password=MD5('$password')");
- if(isset($check['ID'])){
- if(isset($ban['ID'])){ $err = 'This account is banned!'; }
- else
- {
- $_SESSION['username'] = $check['Name'];
- $_SESSION['password'] = $_POST['password'];
- header('location: index.php?id='.$check['ID'].'');
- }
- }else{
- $err = 'Incorrect username or password!';
- }
- }
- include 'includes/header.php';
- ?>
- <form method="POST" action="login.php">
- <center><table id="loginstyle">
- <h1>Login</h1>
- <?php if(isset($err)): ?><font color='#FF0000'><?=$err?></font><?php endif; ?>
- <tr>
- <td><input class="inputs" type="text" name="username" placeholder="Username" /></td>
- </tr>
- <tr>
- <td><input class="inputs" type="password" name="password" placeholder="Password" /></td>
- </tr>
- <td>
- <input class="button" type="submit" value="Submit">
- </td>
- </table></center>
- </form>
- <?php include 'includes/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement