samedi 24 avril 2021

php script doesn't redirect to another file

https://ncci.in/adminac/index.php this is the link of my php script but it is not redirecting to another php file named userlist.php.When i try to login it load same(index.php) page again . Here is the code

<?php
include 'connect.php';
$email=$_POST['userid'];
$password=$_POST['password'];
if(isset($_POST['submit']))
{
$sql="select id,name,email,password from login where email='$email' and password='$password'";
$res=mysqli_query($db,$sql);
session_start();
if($count=mysqli_num_rows($res)>0){
//  echo $count;
    $row=mysqli_fetch_row($res);
    
    $today = date("d-m-Y");
    $_SESSION['cday']=$today;
    $_SESSION['aname']=$row[1];
    $_SESSION['aid']=$row[0];
    $_SESSION['ctime']= $today = date('H:i:s'); 
    header('Location: userlist.php');}
}
?>

This code is very first part of my index.php file.I want to redirect to the userlist.php file. Please help me(I am new to PHP programming).




Aucun commentaire:

Enregistrer un commentaire