Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. include('include/config.php');
  3. echo '<html><head><title>Prodigy Booter</title></head><body>';
  4.  
  5. if (isset($_POST['submit'])) {
  6.     if (!(isset($_POST['Username']) && isset($_POST['Password']))) { die('Please fill in a Username and Password.'); }
  7.     $Username = mysql_real_escape_string(strip_tags($_POST['Username']));
  8.     $Password = md5(mysql_real_escape_string(strip_tags($_POST['Password'])));
  9.    
  10.     $sql = "SELECT * FROM users WHERE username='" .$Username. "' AND Password='" .$Password. "'";
  11.     $query = mysql_query($sql);
  12.     if (mysql_num_rows($query) > 0) {
  13.         $_SESSION['login'] = $Username;
  14.         echo "Successfully logged in.";
  15.     }
  16.     else {
  17.         echo "Username or password is either wrong or doesn't exist.";
  18.     }
  19. }
  20. else {
  21.     ?>
  22.     <form action='login.php' method='POST'>
  23.     Username: <input type='text' name='Username' /><br />
  24.     Password: <input type='password' name='Password' /><br />
  25.     <input type='submit' name='submit' value='Login' />
  26.     </form>
  27.     <?php
  28. }
  29.  
  30. echo '</body></html>';
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement