[Solved] Can’t redirect to another page in PHP

[ad_1]

if(!$k)
{
    echo "Koneksi Gagal <br>";
    echo mysqli_errno();
}
else
{   echo "Koneksi Berhasil";
}

Either of your if-else will run and write something to the response.

you can’t redirect after writing the response.

To redirect set header("Location : select.php"); before echo or any other output

[ad_2]

solved Can’t redirect to another page in PHP