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("../function/function.php");
- $db= new DB($hostname,$username,$password,$database);
- $mid=$_POST['mid'];
- if(!$mid){
- MsgError("至少选中一条");
- }
- //*********删除评论**********
- if($_GET['action']==3){
- $id = $_POST['id'];
- if(!$id){
- MsgError("至少选中一条");
- }
- for($i=0;$i<count($id);$i++){
- $sql = "delete from ".$prefix."revert where id='".$id[$i]."'";
- $db->query($sql,1);
- }
- echo "<script language='javascript'>";
- echo "window.alert('删除成功!');";
- echo "</script>";
- echo "<meta http-equiv="refresh" content="0 url=revert.php?mid=".$mid."">";
- exit();
- }
- //*********删除信息及过期信息********
- for($i=0;$i<count($mid);$i++){
- $ret="delete from ".$prefix."revert where mid='".$mid[$i]."'";
- $sql="delete from ".$prefix."message where mid='".$mid[$i]."'";
- $pic = "select picture from ".$prefix."message where mid='".$mid[$i]."'";
- $result = $db->query($pic,1);
- $row = $db->fetch_array($result);
- if($row["picture"]){
- $handle = explode(".",$row["picture"]);
- $file = date("Y-m-j",$handle[0]);
- $path = '../upload/'.$file.'/'.$row["picture"];
- unlink($path);
- }
- $db->query($sql,1);
- $db->query($ret,1);
- }
- echo "<script language='javascript'>";
- echo "window.alert('提交成功!');";
- echo "</script>";
- if($_GET["action"]==1){
- echo "<meta http-equiv="refresh" content="0;url=manage.php">";
- }
- if($_GET['action']==2){
- echo "<meta http-equiv="refresh" content="0;url=outdatemessage.php">";
- }
- $db->close();
- ?>