Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2. }
  3. elseif(!empty($_POST['username']) && !empty($_POST['password']))
  4. {
  5. $username = mysql_real_escape_string($_POST['username']);
  6. $password = md5(mysql_real_escape_string($_POST['password']));
  7.  
  8. $checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
  9.  
  10. if(mysql_num_rows($checklogin) == 1)
  11. {
  12. $row = mysql_fetch_array($checklogin);
  13. $email = $row['EmailAddress'];
  14.  
  15. $_SESSION['Username'] = $username;
  16. $_SESSION['EmailAddress'] = $email;
  17. $_SESSION['LoggedIn'] = 1;
  18.  
  19. echo '<div class="sb">';
  20. echo '<div class="sbt">Success</div>';
  21. echo '<div class="sbn">';
  22. echo "<p>We are now redirecting you to the member area.</p>";
  23. echo "<meta http-equiv='refresh' content='=2;index.php' />";
  24. }
  25. else
  26. {
  27. echo '<div class="sb">';
  28. echo '<div class="sbt">Error</div>';
  29. echo '<div class="sbn">';
  30. echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
  31. }
  32. }
  33. else
  34. {
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement