我有一个 PHP 页面,当您尝试删除一条记录时,它会重定向到另一个页面,而不是删除它只是刷新的记录。
我order_id
从上一个 PHP 页面得到...
<?php
session_start();
include("confing/db.php");
include("confing/funtion.php");
require_once('stas/config.php');
if(isset($_SESSION['idart23'])){
$idses = ($_SESSION['idart23']);
$uesrnameses = ($_SESSION['username']);
$passwordses = ($_SESSION['password']);
$query = mysql_query("SELECT * FROM `admins` WHERE username='".$uesrnameses."' AND id='".$idses."'");
if($rowadmin = mysql_fetch_array($query)) {
}else{
die(header("Location: login.php"));
}
}else{
die(header("Location: login.php"));
}
$order_id=$_GET['ID'];
header("Location: orders.php");
if (isset($order_id)) {
$query = mysql_query("DELETE FROM `orders` WHERE `ID`='$order_id' ");
$time = date("d/m/Y , h:i:s");
$act = "מחיקת עמוד";
$nameadmin = $rowadmin['firstname'];
mysql_query("INSERT INTO `logs` ( `time` , `act` , `admin`) VALUES ('$time' , '$act' , '$nameadmin') ;") or die ("$error[errorcoontodb]");
}else{ exit('\$order_id isnt set!'); }
?>
我怎样才能解决这个问题?