Guest User

Untitled

a guest
Feb 8th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. i try to delete and chack the session_start(), and allso try to write
  2. echo to see if its pass the login.
  3.  
  4. <?php
  5. session_start();
  6. if(isset($_POST['login_button'])){
  7.  
  8. $email = filter_var($_POST['log_email'],FILTER_SANITIZE_EMAIL);
  9. $_SESSION['log_email'] =$email; //store email into session variable
  10.  
  11. $password = md5($_POST['log_password']); **get password**
  12.  
  13. $chack_database_query = mysqli_query($con,"SELECT * FROM users WHERE
  14. email='$email' AND password = '$password'");
  15. **get email and password from data base**
  16.  
  17. $chack_login_query = mysqli_num_rows($chack_database_query);
  18. //if its match it sand 1
  19. if($chack_database_query == 1){
  20. $row = mysqli_fetch_array($chack_database_query);
  21. $username = $row['username'];
  22. $_SESSION['username'] = $username; **save user name**
  23. header("Location: index.php");
  24. exit();
  25. }
  26. else{
  27. array_push($error_array,"email or password was incorrect <br>");
  28. }
  29. }
  30. ?>
  31.  
  32. ** its pass the chack and enter the next page any way (even the password
  33. and email is not corect). **
Add Comment
Please, Sign In to add comment