我正在尝试创建一个重定向但由于某种原因它不起作用,对于我的生活我无法弄清楚为什么。 if命令运行良好但不是其他。
有什么建议吗?
$sql="SELECT * FROM $tbl_name WHERE uid='";
$sql=$sql . $xoopsUser->uid("s") . "' ";
// Get a specific result from the "example" table
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) == 0) {
print "<div class='blockTitle'><strong>DOWNLOADS</strong></div><p><br><p>";
echo "<div align='center'>You currently have no projects pending payment.<p>If you just completed a transaction but missed the link on the PayPal page, click <a href='http://site.co.uk/site/modules/cjaycontent/index.php?id=6'>here</a>.</div>";
}
else{
header('Location: http://site.co.uk/site/myComposerList2.php');
}
答案 0 :(得分:2)
您需要使用exit
,header
不会立即停止脚本执行。
像这样:
header('Location: http://site.co.uk/site/myComposerList2.php');
exit;