嘿伙计们我有这样的网页
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>";
如果我点击按钮,它将重定向到Conside.php。要做更新查询,这是我的Conside.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");
?>
我的问题是如何使用这样的参数将标题返回到pesananwaiting.php
pesananwaiting.php?pilih=13
谢谢
答案 0 :(得分:2)
您可以通过按钮将$_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>";
然后,在$_GET['pilih']
中回显pesananwaiting.php
:
header("Location:pesananwaiting.php?pilih=" . $_GET['pilih']);