我想从此SQL表中获取landing_page值并将其添加到标题位置
:我在页面顶部有以下代码,但这给了我一个空白页:
<?php
foreach($[user_name] as $user) {
$location="Location:http://".$user['landing_page'];
header($location);
}
?>
<!-- if you need user information, just put them into the $_SESSION variable and output them here -->
Order: <?php echo $_SESSION['user_name']; ?>. You are securely logged in.
我哪里错了?
原始代码是一个登录脚本,我试图让用户在登录后进入google.com
答案 0 :(得分:1)
您没有正确附加变量。试试,
header('"'.$user['landing_page'].'");
答案 1 :(得分:1)
我认为你可以通过在标题
中附加参数来实现header("Location: " . $user['landing_page']);
答案 2 :(得分:0)
试试这个:
<?php
header("Location: ".$user['landing_page']);
?>
答案 3 :(得分:0)
试试这个
<?php
foreach($user_name as $user) {
header("Location:http://".$user['landing_page']);
}
?>
或
<?php
foreach($user_name as $user) {
$location="Location:http://".$user['landing_page'];
header($location);
}
?>