点击删除,跳转到delproduct.php页面
下面我们就来看delproduct.php页面的代码:
<?php require_once('conn.php'); $id = $_GET['id']; $sql = "DELECT from product where id='$id'"; $res = mysql_query($sql); if($res){ echo "<script>alert('删除产品成功');location.href='product.php'</script>"; }else{ echo "<script>alert('删除产品失败');location.href='product.php'</script>"; } ?>
获取表单传过来的参数id 然后根据id 进行删除