我已经设置了重定向,但这里的代码不起作用:
if($result){
$sql_result = mysql_query("SELECT * FROM `application` ORDER BY `application`.`app_id`
DESC LIMIT 0, 1");
$row = mysql_fetch_assoc($sql_result);
echo $row['app_id'];
echo $app_id;
header('Location: payment.php?id=$row['app_id']');
exit();
}
页面没有重定向,只是返回一个空白页面。有任何想法吗? 感谢。
答案 0 :(得分:3)
尝试
header('Location: payment.php?id='.$row['app_id']);
答案 1 :(得分:2)
试试这样:
header("Location: payment.php?id=".$row['app_id']);
答案 2 :(得分:2)
尝试用
替换最后一行header('Location: payment.php?id='.$row['app_id']);
exit();
答案 3 :(得分:-1)
if($result){
$sql_result = mysql_query("SELECT * FROM `application` ORDER BY `application`.`app_id`
DESC LIMIT 0, 1");
$row = mysql_fetch_assoc($sql_result);
echo $row['app_id'];
echo $app_id;
?>
<script>
window.location=payment.php?id=<?php echo $row['app_id'];?>
</script>
<?php
exit();
}
?>