簡體   English   中英

PHP重定向頁面和Echo數據獲取字符串

[英]PHP redirect page and Echo data for get string

我有以下PHP代碼來重定向我的頁面

我需要回顯從上一頁繪制的部分以協助重定向

//Sleep for five seconds.
sleep(5);

//Redirect using the Location header.
header('Location: case_management.php?id=<? echo $rows['case_id']; ?>');
//Post reply drawn
$sla_client = $_POST['sla_client'];
$case_id = $_POST['case_id'];
$status = $_POST['status'];

它給了我意外的case_id。 我認為這是由於我的字符串的回聲面而發生的。 任何援助將不勝感激

case_id是使用POST從上一頁中提取的,而我試圖使用該信息從該頁面上的POST答復中重定向該頁面。 我知道我上面的代碼試圖在數據庫中查找行,但是這種方式將找不到它。 關於如何使用POST回復在URL中使用的任何建議

您在另一個已經打開的php標簽內打開了一個php標簽。 我更正了您的代碼。

//Sleep for five seconds.
sleep(5);

//Redirect using the Location header.
header('Location: case_management.php?id=' . $rows['case_id']);
//Post reply drawn
$sla_client = $_POST['sla_client'];
$case_id = $_POST['case_id'];
$status = $_POST['status'];
header("Location: case_management.php?id=".$rows['case_id']);

$_GET['id']訪問值

如果沒有,先轉儲$rows['case_id']並檢查錯誤

嘗試這個 :-

$getVariable = $rows['case_id'];
  header("Location:case_management.php?id=".urlencode("$getVariable"));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM