onde está o erro neste login.php?
<?php
error_reporting(1);
include("connection.php");
//grab values email and password from login form
$login_email = $_POST('login_email');
$login_password = $_POST('login_password');
//create the query and number of rows returned from the query
$query = mysqli_query($dbc, "SELECT * FROM users WHERE email='".$login_email."'");
$numrows = mysqli_num_rows($query);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
//created condition to check if there is 1 row with that email
if ($numrows != 0) {
//grab the email and password from that row returned before
while ($row = mysqli_fetch_array($query)) {
$dbemail = $row['email'];
$dbpass = $row['password'];
}
//create condition to check if email and password are equal to the returned row
if ($login_email==$dbemail) {
if ($login_password==$dbpass) {
echo "You are in";
}else{
echo "Your password is incorrect";
}
}else{
echo "Your email is incorrect!";
}
}else{
echo "You are not registered. Please register bellow...";
}
}else{
echo "Please Login...";
}
?>
<html lang="en">
<head>
<title></title>
</head>
<body>
<form method="post" action="login1.php">
<p>Email<input type="text" name="login_email"></p>
<p>Password<input type="password" name="login_password"></p>
<p><input type="submit" name="Login"></p>
</form>
</body>
</html>
↧