<?php
session_start();
if (isset($_POST["user_name"]) && isset($_POST["user_pwd"])) {
include"php/connect_to_mysql.php";
$user_name = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["user_name"]);
$user_pwd = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["user_pwd"]);
$sql = "SELECT * FROM user_ac WHERE user='$user_name' OR email='$user_name' AND pwd='$user_pwd' LIMIT 1";
$result = mysqli_query($myConnection, $sql);
if (mysqli_num_rows($result) > 0) {
echo "Successfully Logged In";
header("location: login.html?abc=234");
} else {
}
} else {
}
In this code, inside the second if
statement, echo
is not displaying anything, but the header
function executes correctly.
Please help, thanks.