delete.php
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- <?php
- /*
- [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
- This is NOT a freeware, use is subject to license terms
- 时间:2007年12月
- 描述:删除
- */
- error_reporting(0);
- require("../../config.php");
- require("../../class/mysql_class.php");
- require_once("../../function/function.php");
- $db= new DB($hostname,$username,$password,$database);
- $search = $_GET['search'];
- $sort = $_GET['sort'];
- $mid = $_POST['mid'];
- $cid = $_GET["cid"];
- if(!$mid){
- MsgError("至少选中一条");
- }
- if($_GET['action']==4){
- $id = $_POST['id'];
- for($i=0;$i<count($id);$i++){
- $sql = "delete from ".$prefix."revert where id='".$id[$i]."'";
- $db->query($sql,1);
- }
- ExeSuccess("删除成功!","revert.php?mid={$mid}");
- }
- for($i=0;$i<count($mid);$i++){
- $sql="delete from ".$prefix."message where mid='".$mid[$i]."'";
- $ret="delete from ".$prefix."revert where mid='".$mid[$i]."'";
- $result=$db->query("select picture from ".$prefix."message where mid='".$mid[$i]."'",1);
- $row=$db->fetch_array($result);
- $picture=$row["picture"];
- if($picture){
- $handle = explode(".",$picture);
- $file = date("Y-m-j",$handle[0]);
- $path = '../../upload/'.$file.'/'.$picture;
- unlink($path);
- }
- $db->query($sql,1);
- $db->query($ret,1);
- }
- if($_GET['action']==1){
- ExeSuccess("删除成功!","mm.php");
- }
- if($search||$sort){
- ExeSuccess("删除成功!","search.php?search={$search}&sort={$sort}");
- }
- if($cid){
- ExeSuccess("删除成功!","search.php?cid={$cid}");
- }
- if($_GET['action']==3){
- ExeSuccess("删除成功!","outdatemessage.php");
- }
- $db->close();
- ?>