[php]代码库
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品删除</title>
</head>
<body>
<?php
//获得要删除的产品ID
$id=$_GET['id'];
echo $id;
//连接数据库
require "../public/dbcn.php";
$dbcn->exec("set names utf8");
//构造sql语句
$sql="delete from products where proID=$id";
if($dbcn->exec($sql)){
header('loctation:admin.php');
}else{
die('删除失败!');
}
?>
</body>
</html>
初级程序员
by: 梦泪 发表于:2019-06-05 15:44:31 顶(0) | 踩(0) 回复
回复评论