下面使用的一组代码,是使用一个当地、而不是我的“蓝盔”服务器进行直接工程:
if ($_POST[ submit ]== No )
{
$url = Location: index.php?id= .$id. &page= .$page;
header($url);
exit;
}
当服务器进入这一编码系统时,绝对不会发生。 没有错误,没有警告,只是一页空白。 我的表格中转头页,除将用户重新引向相关网页外,还应做任何事情。
I m pretty dang positive it has nothing to do with the common problem of including HTML before the redirect (since it works locally). Therefore I suspect it has something to do with differences between my php.ini files. I ve pulled up PHPinfo() for both servers, and my local server has a module named mod_headers while my Bluehost server has none. I think this potentially could be the problem, although normally my Bluehost has no problems using header redirects, except in this one instance.
因此,我怀疑这个问题与我的手法有关,但我不知道什么。
What makes this problem even stranger is that there are other blocks of code which work just fine, for instance
if(!empty($_POST[ id ]))
{
$id = htmlentities(strip_tags($_POST[ id ]));
$sql = "UPDATE entries SET title=?, entry=? WHERE id=? LIMIT 1";
$stmt = $db->prepare($sql);
$stmt->execute(array($title,$entry,$id));
$stmt->closeCursor();
$url= Location: ../index.php?id= .$id. &page= .$page;
header($url);
exit;
}
works just great.