我创建了登录页面,该登录页面在用户名和密码之后访问了我的其他页面。但是问题是,当我为其他页面创建会话时,我不想在没有登录的情况下被指控。我被指示从登录页面再次登录
<?php
session_start();
if(isset($_POST['submit'])){
$user=$_POST['user'];
$password=$_POST['password'];
$query="SELECT * FROM login WHERE user='$user' && password='$password'";
$data=mysqli_query($db_conn,$query);
$total=mysqli_num_rows($data);
if($total==1) {
echo("Login Sucessfull");
$_SESSION['log']=1;
header("refresh:3;url=customer_data_ie.php");
}
elseif($total==is_null()){
echo("Invalid User");
header("refresh:2;url=login_page_crm.php");
}
else{
echo "Invalid User";
}
}
?>
<?php
session_start();
if(isset($_SESSION['user'])){
header("location:login_page_crm.php");
}else{
header("location:customer_data_ie.php");
}