Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i try to delete and chack the session_start(), and allso try to write
- echo to see if its pass the login.
- <?php
- session_start();
- if(isset($_POST['login_button'])){
- $email = filter_var($_POST['log_email'],FILTER_SANITIZE_EMAIL);
- $_SESSION['log_email'] =$email; //store email into session variable
- $password = md5($_POST['log_password']); **get password**
- $chack_database_query = mysqli_query($con,"SELECT * FROM users WHERE
- email='$email' AND password = '$password'");
- **get email and password from data base**
- $chack_login_query = mysqli_num_rows($chack_database_query);
- //if its match it sand 1
- if($chack_database_query == 1){
- $row = mysqli_fetch_array($chack_database_query);
- $username = $row['username'];
- $_SESSION['username'] = $username; **save user name**
- header("Location: index.php");
- exit();
- }
- else{
- array_push($error_array,"email or password was incorrect <br>");
- }
- }
- ?>
- ** its pass the chack and enter the next page any way (even the password
- and email is not corect). **
Add Comment
Please, Sign In to add comment