下面是代码:PHP头重定向不起作用
<?php
$curDate = date("r",strtotime("now"));
if($database->addNewSale($_SESSION['username'],$_SESSION['userid'], $_SESSION['cart'],$curDate) ==10){
//Some of the offers in the cart have expired and cannot be purchased!
header("Location: ../order/index.php");
exit;
} else if($database->addNewSale($_SESSION['username'],$_SESSION['userid'], $_SESSION['cart'],$curDate)){
echo "insert process ok";
}
else echo "sale has not been saved into the db";
?>
但是,当函数addNewSale
返回10
这是在车的错误代码,重定向头功能实际上并不重定向到页面我组。
是否有错误信息? – 2011-06-08 07:29:12
'<?php'标签之前的空格是否是您在此处编写的内容,或者实际上是否在您的页面中?任何错误? (你设置了什么error_reporting级别?) – 2011-06-08 07:31:31
它根本不重定向吗?它会去哪个页面?有没有可能../order/index.php不存在,你又被弹回到404页面? – Paolo 2011-06-08 07:32:03