如何從一個PHP頁面重定向到HTML頁面,頁眉心不是在下面的代碼重定向從一個PHP頁面到HTML頁面
<?php include "submit.html";
define('DB_NAME','form');
define('DB_USER','root');
define('DB_PASSWORD','toor');
define('DB_HOST','localhost');
$link = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link)
{
die('could not connect : ' . mysql_error());
}
$db_selected = mysql_select_db(DB_NAME,$link);
if(!$db_selected)
{
die('Can\'t use ' .DB_NAME . ': ' .mysql_error());
}
$value1 = $_POST['fname'];
$value2 = $_POST['Place'];
$value3 = $_POST['Country'];
$value4 = $_POST['rname'];
$value5 = $_POST['food'];
$value6 = $_POST['ambience'];
$value7 = $_POST['service'];
$value8 = $_POST['clean'];
$value9 = $_POST['pfacility'];
$value10 = $_POST['Entertainment'];
$value11 = $_POST['suggestions'];
$sql = "INSERT INTO demo1 (fname,Place,Country,rname,food,ambience,service,clean,Parking_facilities,Entertainment,suggestions) VALUES ('$value1','$value2','$value3','$value4','$value5','$value6','$value7','$value8','$value9','$value10','$value11')";
if(!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
mysql_close();
header('Location: localhost/submit.html',true);
?>
我如何從這裏重定向工作,爲什麼上面的代碼不工作?
失蹤分號'include'語句之後發送的文本後,瀏覽器,在這種情況下? –
定義「不工作」?你會得到什麼錯誤?你做了什麼來解決這個問題? –
'不工作' - 它以什麼方式「不工作」?是否有錯誤訊息?有什麼事情發生嗎? – 2013-10-08 18:38:11