dotype.php

来自「PHP免费网摘程序 详细说明: 安装说明: 1、把文件上穿上去以后」· PHP 代码 · 共 107 行

PHP
107
字号
<? include("../conn.php");?>
<? include("../include/function.php"); 
session_start();
$manager=$_SESSION[manager];
if($manager!="oktop"){
	header("Location:error.htm");
}
?>
<?  
 
 
$order=$_POST[order];

$todo=trim($_GET['do']);
$action=trim($_POST['action']);
if($action=='editforum'){
foreach($order as $key=>$vieworder){
		 
		mysql_query("UPDATE type SET shunxu='$vieworder'  WHERE id='$key'");
	}
}


$action=trim($_POST['action']);
if($action=='addbigtype'){
$typename=$_POST[typename];
if($typename==""){



}
else
{
mysql_query("insert into type (typename,ismain) values ('$typename','1')");
}
} 


if($action=='addtype'){
$typename=$_POST[typename];
$parentid=$_POST[parentid];
if($typename==""){



}
else
{
mysql_query("insert into type (typename,ismain,parentid) values ('$typename','1','$parentid')");
}
} 


if($action=='delete'){
$id=$_POST[fid];

if($id=="" or !is_numeric($id)){
echo "参数错误!";
}
else
{
$arid=getchild($id);

$sql="delete from type where id in ($arid) ";
  
 
mysql_query($sql);
mysql_query("delete from zhai where typeid in ($arid)  ");
 
}
} 


if($action=='unitetype'){
$id=$_POST[fid];
$tofid=$_POST[tofid];
//判断目标类别是否是源类别的子类别
$select="select * from type where parentid='$id' and id='$tofid' limit 1";
$qr=mysql_query($select);
if($ar=mysql_fetch_array($qr)){
$select="select * from type where id='$id' limit 1";
$query=mysql_query($select);
$arr=mysql_fetch_array($query);
$parentid=$arr[parentid];
mysql_query("update type set parentid='$parentid'   where id ='$tofid'");
}
//判断结束
mysql_query("delete from type where id ='$id'");
mysql_query("update type set parentid='$tofid'   where parentid ='$id'");
mysql_query("update zhai set typeid='$tofid'   where typeid ='$id'"); 
 
} 


 
$from=$_GET[from];
if($from!=""){
header("Location:$from");
	die();
	}
	$from=$_POST[from];
if($from!=""){
header("Location:$from");
	die();
	}
header("Location:settype.php");
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?