Advertisement
Guest User

Untitled

a guest
Nov 6th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. if($_SERVER["REQUEST_METHOD"] == "POST") {
  2.  
  3. $myusername = mysqli_real_escape_string($db,$_POST['email']);
  4. $mypassword = md5 (mysqli_real_escape_string($db,$_POST['password']));
  5.  
  6. $sql = "SELECT id FROM users WHERE email = '$myusername' and password = '$mypassword'";
  7. $result = mysqli_query($db,$sql);
  8. $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
  9. $active = $row['active'];
  10.  
  11. $count = mysqli_num_rows($result);
  12.  
  13. if($count == 1) {
  14. $_SESSION['login_user'] = $myusername;
  15.  
  16. header("location: dashboard.php");
  17. echo "test";
  18. }else {
  19. $error = "Your Login Name or Password is invalid!";
  20. echo $error;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement