[英]PHP - Header Redirect - passing variable
我瀏覽了這里的大量頁面,但找不到答案。 我想重定向用戶。 我使用的代碼無法正常工作。 任何幫助,將不勝感激。
header('Location: home.php?username='<?php echo $user['username'];?>);
<?php
標記對字符串不起作用。 使用.
代替:
header('Location: home.php?username=' . $user['username']);
確保您調用exit();
緊隨其后:) x
我認為這是語法錯誤:
header('Location: home.php?username='<?php echo $user['username'];?>);
嘗試以下方法:
header('Location: home.php?username=' . $user['username']);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.