-1

i want to direct user to another page after succesful login. below is my code. how to resolve this?

$result = mysqli_query($mysqli, $query);
 //$result = mysqli_multi_query($mysqli, $query);
$data = mysqli_fetch_array($result);


$data= var_dump($data);
echo $data;

if($data != "NULL"){
 
  header("Location:home2.php");
}
else {
 echo "sorry" ;
}
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
kavi
  • 5
  • 2

1 Answers1

0

Remove

$data= var_dump($data);
echo $data;

and you will be redirected. If you echo anything before to use header this function does not work.

Serghei Leonenco
  • 3,478
  • 2
  • 8
  • 16
  • thank you.. it works. ive remove it and modify that piece of code if($data ){ header("Location:home2.php"); } else { echo "sorry" ; } – kavi Mar 01 '20 at 05:03