Advertisement
Guest User

criptare md5

a guest
Aug 30th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2. include 'includes/config.php';
  3. if(isset($_POST['username']) && isset($_POST['password'])){
  4. $username = sec($_POST['username']);
  5. $password = sec($_POST['password']);
  6.  
  7.  
  8. $ban = get_row("SELECT ID FROM bans WHERE Name='$username'");
  9. $check = get_row("SELECT ID, Name FROM players WHERE Name='$username' OR AName='$username' && Password=MD5('$password')");
  10. if(isset($check['ID'])){
  11. if(isset($ban['ID'])){ $err = 'This account is banned!'; }
  12. else
  13. {
  14. $_SESSION['username'] = $check['Name'];
  15. $_SESSION['password'] = $_POST['password'];
  16. header('location: index.php?id='.$check['ID'].'');
  17. }
  18. }else{
  19. $err = 'Incorrect username or password!';
  20. }
  21. }
  22.  
  23. include 'includes/header.php';
  24.  
  25. ?>
  26.  
  27.  
  28. <form method="POST" action="login.php">
  29. <center><table id="loginstyle">
  30. <h1>Login</h1>
  31. <?php if(isset($err)): ?><font color='#FF0000'><?=$err?></font><?php endif; ?>
  32. <tr>
  33. <td><input class="inputs" type="text" name="username" placeholder="Username" /></td>
  34. </tr>
  35.  
  36. <tr>
  37. <td><input class="inputs" type="password" name="password" placeholder="Password" /></td>
  38. </tr>
  39.  
  40. <td>
  41. <input class="button" type="submit" value="Submit">
  42. </td>
  43. </table></center>
  44. </form>
  45.  
  46.  
  47. <?php include 'includes/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement