0

hi im following a tutorial and when i went to test the login i press login but nothing happens can anyone check the code as i cant se whats up with the form

<?php
session_start();

include("includes/database.php");
if(isset($_POST['login'])) {

    $email = mysqli_real_escape_string($con,$_POST['email']);
    $pass = mysqli_real_escape_string($con,$_POST['pass']);

    $get_user = "SELECT * FROM users WHERE user_email='$email' AND user_pass='$pass'";

    $run_user = mysqli_query($con,$get_user);

    $check = mysqli_num_rows($run_user);

    if($check==1) {
        $_SESSION['user_email']=$email;
        echo "<script>window.open('home.php','_self')</script>";

    } 
    else {
        echo "<script>alert('the email or password you entered is incorrect please try again!')</script>";
    }
}
?>
<form action="" method="post">
<table>
<tr>
<td>Email Address</td><td><input type="text" id="email" name="email" placeholder="Email Address" required="required" /></td>
</tr><tr>
<td>Password</td><td><input type="password" id="pass" name="pass" placeholder="Password" required="required" /></td>
</tr><tr>
<td colspan="2"><input type="submit" value="Login" id="login" name="login" /></td>
</tr>
</table>
</form>

any help would be much appreciated

1
Contributor
1
Reply
10
Views
1 Year
Discussion Span
Last Post by janicemurby
0

sorted it out :) i had the section in header.php file and i had to remove the code and put link instead

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.