获取字符串的PHP重定向页面和回显数据

获取字符串的PHP重定向页面和回显数据,php,Php,我有以下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']; $c

我有以下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'];
它给了我意想不到的案例id。我想这是由于我的字符串的回音端造成的。如有任何协助,将不胜感激


案例id是使用POST从上一页中提取的,我正试图使用该信息从该页上的POST回复重定向该页。我知道我上面的代码试图在数据库中查找一行,但这种方式找不到。关于如何在URL中使用POST reply的任何建议

您在另一个已打开的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'];
使用$\u GET['id']访问值

如果没有,请先转储$rows['case\u id',并检查是否有错误

尝试以下操作:-

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

您的语法本身不正确,标题“Location:case_management.php?id=”.$rows['case_id'];你已经在PHP中,所以一个很大的提示是你不需要;我不需要给echo打电话。您可以直接使用它,尽管您可能需要双引号。我记不清了。@Manav试过你的,但仍然没有发送到URLis$rows['case_id'];这包含一些来自数据库的数据?@MohitKumar不,这是从前几页的表单中提取的信息,这是我用来更新数据库的信息,但是你想用它将我重定向到一个具有相同代码的页面吗?你的代码不会返回错误,但也不会给出所需的URL,将178完全保留在case_management.php?id=当代码运行时,$rows['case_id']可能是空的。vardump$rows['case_id']以查看其值。
$getVariable = $rows['case_id'];
  header("Location:case_management.php?id=".urlencode("$getVariable"));