douejuan9162
2015-11-02 09:01
浏览 47
已采纳

无法在PHP中重定向到另一个页面

I'm making a basic site with PHP. Here, I have code that will not work. I want to redirect a page to another page.

<?php

$k = mysqli_connect("localhost","root","","ubm_2015");

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

$nama = $_POST['nama'];
$motor = $_POST['vhc'];
$hobi = $_POST['hobi'];

$query = "insert into data_mhs(nama,motor,hobi) values ('$nama','$motor','$hobi')";

mysqli_query($k,$query);

echo " Query Berhasil ";

header("Location : select.php");


?>

I use header, but it's not working.

Are there any tips to redirect in PHP?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

5条回答 默认 最新

相关推荐 更多相似问题