在下面的代码中,我能够更新数据库,但它没有重定向到标题位置中给出的页面,它刷新并显示相同的页面本身,我从其他在更新数据库和重定向方面效果很好的代码复制了
<?php
if (isset($_POST['submit']))
{
// get form data, making sure it is valid
$firstname = mysql_real_escape_string(htmlspecialchars($_POST['firstname']));
$link = mysql_connect('www.xxxxxxx.co.uk', 'xxxxxx', 'axxxxxd');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("web39-sdasdasd", $link);
mysql_query("INSERT learning_outcome SET topic='$firstname'")
or die(mysql_error());
header('Location: http://www.xxxxxx.co.uk/NottTest/viewlearnpc.php?succmsg=UPDATE SUCCESSFULL');
}
else
echo "";
?>