【php开源代码栏目提醒】:网学会员鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“edit_intodb.php”一文,供大家参考学习
<?php
include("global.php");
include('../include/dbconnect.inc.php');
$cid = $_POST['cid'];
$name = $_POST['category_name'];
$sql = "update category set name='$name' where cid='$cid'";
$rs = mysql_query($
sql);
if($rs) {
header("Location:category_admin.php");
} else {
echo "栏目编辑失败,点击<a href='category_admin.php'>这里</a>返回管理页面!";
}
?>
删除分类信息的代码:
<?php
include("global.php");
include('../include/dbconnect.inc.php');
$cid = $_GET['cid'];
$sql = "delete from category where cid='$cid'";
$rs =
mysql_query($sql);
if($rs) {
header("Location:category_admin.php");
} else {
echo "删除栏目出错,点击<a href='category_admin.php'>这里</a>进入管理页面!";
}
?>