重定向到具有选定网址参数的页面


Redirected to Page with selected url parameter

嘿伙计们,我有这样的网址页面

http://localhost/skripsi3/web/pesananwaiting.php?pilih=13

表格内有一个按钮,代码是这样的

echo "<a href='considered.php?idorder=" . $row['id_order']."'><button type='button' class='btn btn-primary btn-default btn-sm'>Considered</button></a>";

如果我单击该按钮,它将重定向到已考虑.php。要做更新查询,这是我考虑的.php

<?php
session_start();
include "connectdb.php";
$idorder = $_GET["id"];
$cons = "Considered";
$query="UPDATE `preorder` SET `statuspesanan`='$cons' WHERE `id_order`='$_GET[idorder]'";
$result = mysql_query($query);
header("Location:pesananwaiting.php");
?>

我的问题是如何用这样的参数使头回到佩萨南等待.php

pesananwaiting.php?pilih=13

谢谢

您可以通过

按钮将$_GET['pilih']$_GET['idorder']一起发送。

echo "<a href='considered.php?idorder=" . $row['id_order'] . "&pilih=" . $_GET['pilih'] . "'><button type='button' class='btn btn-primary btn-default btn-sm'>Considered</button></a>";

然后,在pesananwaiting.php中回显$_GET['pilih']

header("Location:pesananwaiting.php?pilih=" . $_GET['pilih']);