一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

DEDE采集大师官方留后门的删除办法

时间:2022-06-24 16:03:14 编辑:袖梨 来源:一聚教程网


php教程
require_once(dirname(__file__)."/../include/common.inc.php");
if(emptyempty($dopost))
{
$dopost = "";
}
if($dopost=="rename")
{
if(rename('dedesql.query.php','arc.sqlquery.class.php')){
echo "成功!";
}else{
echo "失败!";
}
exit();
}
if($dopost=="viewinfo")
{
if(emptyempty($tablename))
{
echo "没有指定表名!";
}
else
{
$dsql->setquery("show create table ".$dsql->dbname.".".$tablename);
$dsql->execute('me');
$row2 = $dsql->getarray('me',mysql教程_both);
$ctinfo = $row2[1];
echo "".trim($ctinfo)."";
}
exit();
}
if($dopost=="index")
{
require_once(dedeinc.'/arc.partview.class.php');
$envs = $_sys_globals = array();
$envs['aid'] = 0;
$pv = new partview();
$row = $pv->dsql->getone('select * from `#@__homepageset`');
$templet = str_replace("{style}",$cfg_df_style,$row['templet']);
$homefile = dirname(__file__).'/'.$row['position'];
$homefile = str_replace("//","/",str_replace("","/",$homefile));
$fp = fopen($homefile,'w') or die("无法更新网站主页到:$homefile 位置");
fclose($fp);
$tpl = $cfg_basedir.$cfg_templets_dir.'/'.$templet;
$pv->settemplet($tpl);
$pv->savetohtml($homefile);
$pv->close();
echo "成功更新首页!";
exit();
}
else if($dopost=="query")
{
$sqlquery = trim(strips教程lashes($sqlquery));
if(eregi("drop(.*)table",$sqlquery) ||eregi("drop(.*)database",$sqlquery))
{
echo "删除'数据表'或'数据库教程'的语句不允许在这里执行。";
exit();
}
if(eregi("^select ",$sqlquery))
{
$dsql->setquery($sqlquery);
$dsql->execute();
if($dsql->gettotalrow()<=0)
{
echo "运行sql:{$sqlquery},无返回记录!";
}
else
{
echo "运行sql:{$sqlquery},共有".$dsql->gettotalrow()."条记录,最大返回100条!";
}
$j = 0;
while($row = $dsql->getarray())
{
$j++;
if($j>100)
{
break;
}
echo "
";
echo "记录:$j";
echo "
";
foreach($row as $k=>$v)
{
echo "{$k}:{$v}
rn";
}
}
exit();
}
if($querytype==2)
{
$sqlquery = str_replace("r","",$sqlquery);
$sqls = split(";[ t]{0,}n",$sqlquery);
$nerrcode = "";$i=0;
foreach($sqls as $q)
{
$q = trim($q);
if($q=="")
{
continue;
}
$dsql->executenonequery($q);
$errcode = trim($dsql->geterror());
if($errcode=="")
{
$i++;
}
else
{
$nerrcode .= "执行: $q 出错,错误提示:".$errcode."
";
}
}
echo "成功执行{$i}个sql语句!

";
echo $nerrcode;
}
else
{
$dsql->executenonequery($sqlquery);
$nerrcode = trim($dsql->geterror());
echo "成功执行1个sql语句!

";
echo $nerrcode;
}
exit();
}
if($dopost=="view")
{
;echo '


sql命令行工具
















sql命令运行器: 数据备份
| 数据还原



























系统的表信息:
























返回信息:

运行sql命令行:

单行命令(支持简单查询)

多行命令








';}
?>

热门栏目