require("../config/include.php"); require("../config/inc.php"); //处理表单程序: //首先是用户修改主题帖子的: if(@$_POST["Submit_art"]) { $title=parsecontent($_POST["title"]); $id_cate2=$_POST["id_cate2"]; $content=parsecontent($_POST["content"]); $id_art=$_POST["id_art"]; $old_id_cate2=$_POST["old_id_cate2"]; $time2=date("y-m-d H:i:s"); $url=$_POST["url"]; if($id_cate2==$old_id_cate2) { $sql="update `article` set `title`='$title',`content`='$content',`time2`='$time2' where `id`='$id_art'"; $flag=mysql_query($sql); if($flag) header("Location:".$url); else die("kao"); } else { $id_cate1=get_id_cate1_from_id_cate2($id_cate2); $sql="update `article` set `title`='$title',`id_cate2`='$id_cate2',`content`='$content',`time2`='$time2' where `id`='$id_art'"; $sql2="update `rearticle` set `id_cate2`='$id_cate2' where `id_article`='$id_art'"; $flag=mysql_query($sql); $flag2=mysql_query($sql2); if($flag || $flag2) header("Location:".$url); else die("kao"); } } elseif(@$_POST["Submit_reart"]) //下面是用户修改回复帖子的: { $title=parsecontent($_POST["title"]); $content=parsecontent($_POST["content"]); $id_reart=$_POST["id_reart"]; $time2=date("y-m-d H:i:s"); $url=$_POST["url"]; $sql="update `rearticle` set `title`='$title',`content`='$content',`time2`='$time2' where `id`='$id_reart'"; $flag=mysql_query($sql); if($flag) header("Location:".$url); else die("kao"); } elseif(@$_POST["Delete_art"]) { $id_art=$_POST["id_art"]; $url=$_POST["url"]; $sql1="delete from article where id='$id_art'"; $sql2="delete from rearticle where id_article='$id_art'"; $flag1=mysql_query($sql1) or die(mysql_error()); $flag2=mysql_query($sql2); if($flag1||$flag2) header("Location:index.php"); else die("kao"); } elseif(@$_POST["Delete_reart"]) { $id_reart=$_POST["id_reart"]; $url=$_POST["url"]; $sql="delete from rearticle where id='$id_reart'"; $flag=mysql_query($sql) or die(mysql_error()); if($flag) header("Location:".$url); else die("kao"); } //处理表单程序结束,下面是输出表单的 if(@$_COOKIE["username"]) { $url=getFromUrl();//取得到这个地方的地址 $id_writer=$_GET["id_writer"]; $id_user=get_id_user(@$_COOKIE["username"]); if($id_writer==$id_user)//判断是否为自己的文章 { ?>