关于apache执行cgi的问题,帮帮忙,不知道为什么?

由 networkboy 在 03-15-2004 11:43 发表:

关于apache执行cgi的问题,帮帮忙,不知道为什么?

#!/usr/bin/perl

printenv -- demo CGI program which just prints its environment

print "Content-type: text/plain\n\n";

foreach $var (sort(keys(%ENV))) {

$val = $ENV{$var};

$val =~ s|\n|\\n|g;

$val =~ s|"|\"|g;

print "${var}="${val}"\n";

}

以上脚本能够执行

但是下面的就不行

#!/usr/bin/perl

#############################################################

LeoBoard ver.5000 / LB5000 / 雷傲超级论坛 ver.5000

版权所有: 雷傲工作室(原蓝宝石软件工作室)

制作人 : 山鹰糊 (Shining Hu)

花无缺 (Ifairy Han)

主页地址: http://www.CGIer.com/ CGI 编程者之家

http://www.LeoBoard.com/ 雷傲论坛支持主页

http://www.leoBBS.com/ 本论坛直通车

http://[email protected]/ 大家一起邮

*************************

LB论坛推荐虚拟主机服务商:

雷傲科技: http://www.leoboard.com.cn

全面支持LB所有功能,拥有2年提供LB论坛空间的以及500多个LB用户的经验,可以做的更好

**************************

#############################################################

BEGIN {

$LBPATH = '.';

my $pgm = $0;

$pgm =~s/\///g;

$pgm =~s/^.*/([^/]+)$/$1/g;

unless (-e $LBPATH.'/'.$pgm) {

foreach ($0, $ENV{'SCRIPT_FILENAME'}, $ENV{'PATH_TRANSLATED'}) {

s!\\!/!g; s/^(.*)/[^/]+$/$1/g;

if (-e $_ . '/' .$pgm) { $LBPATH = $_; last; }

}

}

unshift (@INC, "$LBPATH");

}

use LBCGI;

use Archive::Tar;

use Cwd;

$query = new LBCGI;

@params = $query->param;

foreach $param(@params) {

$theparam = $query->param($param);

$theparam =~ s/@/\\@/g;

$theparam =~ s/'//g;

$theparam =~ s/"//g;

${$param} = $theparam;

if ($param ne "action") {

$printme .= "$" . "$param = '$theparam';\n";

}

}

$stylesheet =<<end_of_sheet;

  1<style>   
  2  
  3  
  4  
  5<!--   
  6  
  7  
  8  
  9A:visited { TEXT-DECORATION: none }   
 10  
 11  
 12  
 13A:active { TEXT-DECORATION: none }   
 14  
 15  
 16  
 17A:hover { TEXT-DECORATION: underline overline }   
 18  
 19  
 20  
 21A:link { text-decoration: none;}   
 22  
 23  
 24  
 25  
 26  
 27  
 28  
 29A:visited { text-decoration: none;}   
 30  
 31  
 32  
 33A:active { TEXT-DECORATION: none;}   
 34  
 35  
 36  
 37A:hover { TEXT-DECORATION: underline overline}   
 38  
 39  
 40  
 41  
 42  
 43  
 44  
 45.t { LINE-HEIGHT: 1.4 }   
 46  
 47  
 48  
 49BODY { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 50  
 51  
 52  
 53TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 54  
 55  
 56  
 57SELECT { FONT-FAMILY: 宋体; FONT-SIZE: 9pt; }   
 58  
 59  
 60  
 61INPUT { FONT-FAMILY: 宋体; FONT-SIZE: 9pt; height:22px; }   
 62  
 63  
 64  
 65TEXTAREA{ FONT-FAMILY: 宋体; FONT-SIZE: 9pt; }   
 66  
 67  
 68  
 69DIV { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 70  
 71  
 72  
 73FORM { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 74  
 75  
 76  
 77OPTION { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 78  
 79  
 80  
 81P { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 82  
 83  
 84  
 85TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 86  
 87  
 88  
 89BR { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }   
 90  
 91  
 92  
 93  
 94  
 95  
 96  
 97\-->   
 98  
 99  
100  
101</style>

end_of_sheet

$thisprog = "install.cgi"; $|=1;

$XHTML = 0;

if ($action ne "final_step" || !$action) { print header(-charset=>"gb2312"); print "

1<head><title>LB5000 MX 安装向导 -- CGI 编程者之家</title></head>

$stylesheet

  1<body>"; }   
  2  
  3  
  4  
  5  
  6  
  7  
  8  
  9if ($action eq "step_two") {   
 10  
 11  
 12  
 13  
 14  
 15  
 16  
 17if (-e "${lbdir}cgi-bin.tar"){   
 18  
 19  
 20  
 21my $cwd = cwd();   
 22  
 23  
 24  
 25my $tar = Archive::Tar-&gt;new();   
 26  
 27  
 28  
 29unless ($tar-&gt;read("${lbdir}cgi-bin.tar", 0)) {   
 30  
 31  
 32  
 33print qq~<td align="left" class="w" width="60%">cgi-bin.tar不能读取,请检查是否使用二进制模式上传(一定要这个模式上传这个压缩包)</td>~;   
 34  
 35  
 36  
 37exit;   
 38  
 39  
 40  
 41}   
 42  
 43  
 44  
 45chdir $lbdir;   
 46  
 47  
 48  
 49unless (-w $lbdir){   
 50  
 51  
 52  
 53chmod (0777,$lbdir) if ($lbdir !~ m/\/cgi-bin\/$/i);   
 54  
 55  
 56  
 57opendir (FILE, ".");   
 58  
 59  
 60  
 61@filename = readdir(FILE);   
 62  
 63  
 64  
 65closedir (FILE);   
 66  
 67  
 68  
 69foreach (@filename) {   
 70  
 71  
 72  
 73next if (($_ eq ".")||($_ eq ".."));   
 74  
 75  
 76  
 77chmod(0755,"./$_");   
 78  
 79  
 80  
 81}   
 82  
 83  
 84  
 85}   
 86  
 87  
 88  
 89my @files = $tar-&gt;list_files();   
 90  
 91  
 92  
 93$tar-&gt;extract(@files, $lbdir);   
 94  
 95  
 96  
 97chdir $cwd;   
 98  
 99  
100  
101}   
102  
103  
104  
105if (-e "${lbdir}non-cgi.tar"){   
106  
107  
108  
109my $cwd = cwd();   
110  
111  
112  
113my $tar = Archive::Tar-&gt;new();   
114  
115  
116  
117unless ($tar-&gt;read("${lbdir}non-cgi.tar", 0)) {   
118  
119  
120  
121print qq~<td align="left" class="w" width="60%">non-cgi.tar不能读取,请检查是否使用二进制模式上传(一定要这个模式上传这个压缩包)</td>~;   
122  
123  
124  
125exit;   
126  
127  
128  
129}   
130  
131  
132  
133mkdir($imagesdir,0777);   
134  
135  
136  
137chdir $imagesdir;   
138  
139  
140  
141unless (-w $imagesdir){   
142  
143  
144  
145chmod (0777,$imagesdir);   
146  
147  
148  
149opendir (FILE, ".");   
150  
151  
152  
153@filename = readdir(FILE);   
154  
155  
156  
157closedir (FILE);   
158  
159  
160  
161foreach (@filename) {   
162  
163  
164  
165chmod(0777,"./$_");   
166  
167  
168  
169}   
170  
171  
172  
173}   
174  
175  
176  
177my @files = $tar-&gt;list_files();   
178  
179  
180  
181$tar-&gt;extract(@files, $imagesdir);   
182  
183  
184  
185chdir $cwd;   
186  
187  
188  
189}   
190  
191  
192  
193  
194  
195  
196  
197$endprint = "1\;\n";   
198  
199  
200  
201  
202  
203  
204  
205$errorflag = 0;   
206  
207  
208  
209  
210  
211  
212  
213$filetomake = "$lbdir" . "data/boardinfo.cgi";   
214  
215  
216  
217  
218  
219  
220  
221open(FILE,"&gt;$filetomake");   
222  
223  
224  
225print FILE "$printme";   
226  
227  
228  
229print FILE "\$adfoot = '&lt;a href=http://www.leobbs.com/ target=_blank&gt;&lt;img src=\$imagesurl/images/banner.gif border=0&gt;&lt;/a&gt;';\n";   
230  
231  
232  
233print FILE "\$adscript = '&lt;a href=http://www.leobbs.com/ target=_blank&gt;&lt;img src=\$imagesurl/images/banner.gif border=0&gt;&lt;/a&gt;';\n";   
234  
235  
236  
237print FILE "\n";   
238  
239  
240  
241print FILE $endprint;   
242  
243  
244  
245close(FILE);   
246  
247  
248  
249  
250  
251  
252  
253# &amp;chmodfiles   
254  
255  
256  
257  
258  
259  
260  
261if (-e $filetomake &amp;&amp; -w $filetomake) {   
262  
263  
264  
265$saved_variables = qq(<font face="宋体">所有输入的信息已经成功的写入 ${lbdir}data/boardinfo.cgi 文件中。</font> );   
266  
267  
268  
269}   
270  
271  
272  
273else {   
274  
275  
276  
277$saved_variables = qq(<font color="#FF0000" face="宋体">对不起,不能够保存信息。<br/>   
278  
279  
280  
281请检测您输入的 ${lbdir}data 数据路径是否正确?是不是最后遗漏了除号 '/'?<br/>   
282  
283  
284  
285如果正确,请检查 'data' 目录属性是否设置正确。请返回修改后重新递交表单一次。);   
286  
287  
288  
289$errorflag = "1";   
290  
291  
292  
293}   
294  
295  
296  
297  
298  
299  
300  
301$filetocheck = "$lbdir" . "leoboard.cgi";   
302  
303  
304  
305if (-e $filetocheck) {   
306  
307  
308  
309$found_cgi = qq(<font color="#0000FF" face="宋体">正确</font> );   
310  
311  
312  
313}   
314  
315  
316  
317else {   
318  
319  
320  
321$errorflag = "1"; $found_cgi = qq(<font color="#FF0000" face="宋体">错误 - 找不到 $filetocheck,数据路径是不是最后遗漏了除号 '/'?请返回重新输入正确信息。</font> );   
322  
323  
324  
325}   
326  
327  
328  
329  
330  
331  
332  
333opendir (DIRS, "$lbdir");   
334  
335  
336  
337my @files2 = readdir(DIRS);   
338  
339  
340  
341closedir (DIRS);   
342  
343  
344  
345my @memdir = grep(/^members/, @files2);   
346  
347  
348  
349$memdir=@memdir;   
350  
351  
352  
353if ($memdir eq 0) {   
354  
355  
356  
357@memdir = grep(/^MEMBERS/, @files2);   
358  
359  
360  
361rename("${lbdir}MEMBERS","${lbdir}members");   
362  
363  
364  
365}   
366  
367  
368  
369if ($memdir eq 0) {   
370  
371  
372  
373@memdir = grep(/^Members/, @files2);   
374  
375  
376  
377rename("${lbdir}Members","${lbdir}members");   
378  
379  
380  
381}   
382  
383  
384  
385$memdir = $memdir[0];   
386  
387  
388  
389  
390  
391  
392  
393if ($memdir eq "members") {   
394  
395  
396  
397srand;   
398  
399  
400  
401$x = rand;   
402  
403  
404  
405$x = int($x * 10000000);   
406  
407  
408  
409$x =sprintf("%08d",$x);   
410  
411  
412  
413rename("${lbdir}members","${lbdir}members$x");   
414  
415  
416  
417$memdir="members$x";   
418  
419  
420  
421}   
422  
423  
424  
425  
426  
427  
428  
429opendir (DIRS, "$lbdir");   
430  
431  
432  
433my @files2 = readdir(DIRS);   
434  
435  
436  
437closedir (DIRS);   
438  
439  
440  
441my @memdir = grep(/^members/i, @files2);   
442  
443  
444  
445$memdir = $memdir[0];   
446  
447  
448  
449my @msgdir = grep(/^messages/i, @files2);   
450  
451  
452  
453$msgdir = $msgdir[0];   
454  
455  
456  
457  
458  
459  
460  
461$dirtocheck = "$lbdir" . "data";   
462  
463  
464  
465if (-d "$dirtocheck") {   
466  
467  
468  
469$datadir = "找到";   
470  
471  
472  
473$makefile = "$lbdir" . "data/test.txt";   
474  
475  
476  
477open (TEST, "&gt;$makefile") or $datawritable = "目录 data 为不可写,请改变属性为 777 。";   
478  
479  
480  
481print TEST "-";   
482  
483  
484  
485close (TEST);   
486  
487  
488  
489$datawritable = "属性为<b>可写</b>!" if (!$datawritable);   
490  
491  
492  
493unlink "$makefile";   
494  
495  
496  
497} else { $errorflag = "1"; $datadir = "<b>没有找到</b>!"; }   
498  
499  
500  
501  
502  
503  
504  
505$dirtocheck = "$lbdir" . "help";   
506  
507  
508  
509if (-d "$dirtocheck") {   
510  
511  
512  
513$helpdir = "找到";   
514  
515  
516  
517$makefile = "$lbdir" . "help/test.txt";   
518  
519  
520  
521open (TEST, "&gt;$makefile") or $helpwritable = "目录 help 为不可写,请改变属性为 777 。";   
522  
523  
524  
525print TEST "-";   
526  
527  
528  
529close (TEST);   
530  
531  
532  
533$helpwritable = "属性为<b>可写</b>!" if (!$helpwritable);   
534  
535  
536  
537unlink "$makefile";   
538  
539  
540  
541} else { $helpdir = "<b>没有找到</b>!"; }   
542  
543  
544  
545  
546  
547  
548  
549$dirtocheck = "$lbdir" . "$memdir";   
550  
551  
552  
553if (-d "$dirtocheck") {   
554  
555  
556  
557$membersdir = "找到";   
558  
559  
560  
561$makefile = "$lbdir" . "$memdir/test.txt";   
562  
563  
564  
565open (TEST, "&gt;$makefile") or $memberswritable = "目录 $memdir 为不可写,请改变属性为 777 。";   
566  
567  
568  
569print TEST "-";   
570  
571  
572  
573close (TEST);   
574  
575  
576  
577$memberswritable = "属性为<b>可写</b>!" if (!$memberswritable);   
578  
579  
580  
581unlink "$makefile";   
582  
583  
584  
585} else { $errorflag = "1"; $membersdir = "<b>没有找到</b>!"; }   
586  
587  
588  
589  
590  
591  
592  
593$dirtocheck = "$lbdir" . "$msgdir";   
594  
595  
596  
597if (-d "$dirtocheck") {   
598  
599  
600  
601$messagesdir = "找到";   
602  
603  
604  
605$makefile = "$lbdir" . "$msgdir/test.txt";   
606  
607  
608  
609open (TEST, "&gt;$makefile") or $messageswritable = "目录 $msgdir 为不可写,请改变属性为 777 。";   
610  
611  
612  
613print TEST "-";   
614  
615  
616  
617close (TEST);   
618  
619  
620  
621$messageswritable = "属性为<b>可写</b>!" if (!$messageswritable);   
622  
623  
624  
625unlink "$makefile";   
626  
627  
628  
629} else { $errorflag = "1"; $messagesdir = "<b>没有找到</b>!"; }   
630  
631  
632  
633  
634  
635  
636  
637  
638  
639  
640  
641$filetocheck = "$imagesdir" . "images/logo.gif";   
642  
643  
644  
645if (-e $filetocheck) {   
646  
647  
648  
649$found_image = qq(<font color="#0000FF" face="宋体">正确</font> );   
650  
651  
652  
653}   
654  
655  
656  
657else {   
658  
659  
660  
661$errorflag = "1"; $found_image = qq(<font color="#FF0000" face="宋体">错误,请注意路径最后不要遗漏除号 '/',请点击后退填入正确的信息(是不是你遗漏上传了 images 下的 logo.gif 呢?程序是利用这个文件是否存在来判断你设置是否正确的)。</font> );   
662  
663  
664  
665}   
666  
667  
668  
669  
670  
671  
672  
673$dirtocheck = "$imagesdir" . "images";   
674  
675  
676  
677if (-d "$dirtocheck") { $images_dir = "找到!"; } else { $errorflag = "1"; $images_dir = "<b>没有找到</b>!"; }   
678  
679  
680  
681  
682  
683  
684  
685$dirtocheck = "$imagesdir" . "emoticons";   
686  
687  
688  
689if (-d "$dirtocheck") { $emoticonsdir = "找到!"; } else { $errorflag = "1"; $emoticonsdir = "<b>没有找到</b>!"; }   
690  
691  
692  
693  
694  
695  
696  
697$dirtocheck = "$imagesdir" . "avatars";   
698  
699  
700  
701if (-d "$dirtocheck") { $avatarsdir = "找到!"; } else { $errorflag = "1"; $avatarsdir = "<b>没有找到</b>!"; }   
702  
703  
704  
705  
706  
707  
708  
709$dirtocheck = "$imagesdir" . "usravatars";   
710  
711  
712  
713if (-d "$dirtocheck") {   
714  
715  
716  
717$usravatarsdir = "找到!";   
718  
719  
720  
721$makefile = "$dirtocheck" . "/test.txt";   
722  
723  
724  
725open (TEST, "&gt;$makefile") or $usravatarswritabler = "目录 $dirtocheck 为不可写,请改变属性为 777 。";   
726  
727  
728  
729print TEST "-";   
730  
731  
732  
733close (TEST);   
734  
735  
736  
737$usravatarswritable = "属性为<b>可写</b>!" if (!$usravatarswritable);   
738  
739  
740  
741unlink "$makefile";   
742  
743  
744  
745} else { $errorflag = "1"; $usravatarsdir = "<b>没有找到</b>!"; }   
746  
747  
748  
749  
750  
751  
752  
753$dirtocheck = "$imagesdir" . "usr";   
754  
755  
756  
757if (-d "$dirtocheck") {   
758  
759  
760  
761$usrdir = "找到!";   
762  
763  
764  
765$makefile = "$dirtocheck" . "/test.txt";   
766  
767  
768  
769open (TEST, "&gt;$makefile") or $usrwritabler = "目录 $dirtocheck 为不可写,请改变属性为 777 。";   
770  
771  
772  
773print TEST "-";   
774  
775  
776  
777close (TEST);   
778  
779  
780  
781$usrwritabler = "属性为<b>可写</b>!" if (!$usrwritabler);   
782  
783  
784  
785unlink "$makefile";   
786  
787  
788  
789} else { $errorflag = "1"; $usrdir = "<b>没有找到</b>!"; }   
790  
791  
792  
793  
794  
795  
796  
797$dirtocheck = "$imagesdir" . "btg";   
798  
799  
800  
801if (-d "$dirtocheck") { $btg = "找到!"; } else { $errorflag = "1"; $btg = "<b>没有找到</b>!"; }   
802  
803  
804  
805  
806  
807  
808  
809$dirtocheck = "$imagesdir" . "emot";   
810  
811  
812  
813if (-d "$dirtocheck") { $emot = "找到!"; } else { $errorflag = "1"; $emot = "<b>没有找到</b>!"; }   
814  
815  
816  
817  
818  
819  
820  
821@progs_to_search = ('admincenter.cgi', 'allnews.cgi', 'announcements.cgi', 'code.cgi', 'forumoptions.cgi', 'forums.cgi', 'help.cgi', 'install.cgi', 'index.html', 'lb.lib.pl', 'lbadmin.lib.pl', 'lbfriend.cgi', 'lbmail.lib.pl', 'leoboard.cgi', 'loginout.cgi', 'mailmembers.cgi', 'massmsg.cgi', 'memberlist.cgi', 'messanger.cgi', 'misc.cgi', 'news.cgi', 'noreg.cgi', 'pag.cgi', 'poll.cgi', 'post.cgi', 'postings.cgi', 'postjs.cgi', 'printpage.cgi', 'profile.cgi', 'register.cgi', 'remmail.cgi', 'search.cgi', 'setforums.cgi', 'setipbans.cgi', 'setmemberbak.cgi', 'setmembers.cgi', 'setmembertitles.cgi', 'setskin.cgi', 'setstyles.cgi', 'settemplate.cgi', 'setvariables.cgi', 'shareforums.cgi', 'team.cgi', 'topic.cgi', 'visitforum.lib.pl', 'whosonline.cgi', 'data/styles.cgi');   
822  
823  
824  
825  
826  
827  
828  
829  
830  
831  
832  
833print qq(   
834  
835  
836  
837<font color="#000000" face="宋体" size="5">
838<h1>LB5000 MX 安装向导</h1></font><font color="#000000" face="宋体">   
839  
840  
841  
842程序编制:<a href="mailto:webmaster\@cgier.com">山鹰糊</a> 参与制作:<a href="mailto:info\@cgier.net">花无缺</a><br/>   
843  
844  
845  
846版权所有:<a href="http://www.cgier.com/">CGI 编程者之家</a></font>
847<hr color="#000000" noshade=""/>
848<br/>
849<font color="#000000" face="宋体">
850<b>欢迎使用 LB5000 MX 安装向导!</b>
851<br/><br/>
852<b>第二步:</b> 谢谢您写入信息,下面是尝试安装的结果。<br/>如果您得到了错误信息提示,请确定您已经完整上传了本程序,以及目录属性、位置设定正确。</font><br/>
853<hr color="#000000" noshade=""/>
854<font color="#0000FF" face="宋体">
855<br/><b>您键入的安装信息是否正确保存?</b></font>
856<br/>   
857  
858  
859  
860$saved_variables   
861  
862  
863  
864<br/><br/>
865<hr color="#000000" noshade=""/>
866<font color="#0000FF" face="宋体">
867<br/><b>路径预览</b></font>
868<br/>
869<font color="#000000" face="宋体">   
870  
871  
872  
873所有程序(*.cgi)的路径: $lbdir - $found_cgi   
874  
875  
876  
877<br/><br/>   
878  
879  
880  
881\-- 查找 ${lbdir}data - $datadir - $datawritable<br/>   
882  
883  
884  
885\-- 查找 ${lbdir}help - $helpdir - $helpwritable<br/>   
886  
887  
888  
889\-- 查找 ${lbdir}$msgdir - $messagesdir - $messageswritable<br/>   
890  
891  
892  
893\-- 查找 ${lbdir}$memdir - $membersdir - $memberswritable<br/>
894<br/>
895<br/>
896<font color="#000000" face="宋体">   
897  
898  
899  
900所有非 CGI 文件(images)的路径: $imagesdir - $found_image   
901  
902  
903  
904<br/><br/>   
905  
906  
907  
908\-- 查找 ${imagesdir}images - $images_dir<br/>   
909  
910  
911  
912\-- 查找 ${imagesdir}emoticons - $emoticonsdir<br/>   
913  
914  
915  
916\-- 查找 ${imagesdir}avatars - $avatarsdir<br/><br/>   
917  
918  
919  
920\-- 查找 ${imagesdir}usravatars - $usravatarsdir - $usravatarswritable<br/><br/>   
921  
922  
923  
924\-- 查找 ${imagesdir}usr - $usrdir - $usrwritabler<br/><br/>   
925  
926  
927  
928\-- 查找 ${imagesdir}btg - $btg<br/><br/>   
929  
930  
931  
932\-- 查找 ${imagesdir}emot - $emot<br/><br/>
933<hr color="#000000" noshade=""/>
934<font color="#0000FF" face="宋体">
935<br/><b>URL 预览</b></font>
936<br/>
937<font color="#000000" face="宋体">   
938  
939  
940  
941您输入的图片 URL: $imagesurl   
942  
943  
944  
945<br/>
946<br/>   
947  
948  
949  
950\-- 查找 $imagesurl/images/announce.gif - <img border="0" src="$imagesurl/images/announce.gif"/><br/>   
951  
952  
953  
954\-- 查找 $imagesurl/emoticons/smile.gif - <img border="0" src="$imagesurl/emoticons/smile.gif"/><br/>   
955  
956  
957  
958\-- 查找 $imagesurl/avatars/noavatar.gif - <img border="0" src="$imagesurl/avatars/noavatar.gif"/><br/><br/>   
959  
960  
961  
962如果您看到的是错误的图片,请检查这个 $imagesurl 路径是否正确,同时也请确定图片文件是否是以 Binary 方式上传的。<br/><br/>   
963  
964  
965  
966);   
967  
968  
969  
970if ($errorflag eq "1") { print qq(<br/><br/><font color="#FF0000">LB5000 MX 安装向导发现错误,不能够继续。请返回重新填入正确的信息); print "</font></font></font></font></font></body>

"; exit; }

print qq(

1<hr color="#000000" noshade=""/>
1<font color="#0000FF" face="宋体">
2<b>文件合法性检查</b></font>
1<br/>
1<br/>
   1<font color="#000000" face="宋体">   
   2  
   3  
   4  
   5LB5000 MX 安装向导将检查您的所有 CGI 文件是否已上传,并且是以 ASCII 方式上传的   
   6  
   7  
   8  
   9<br/><br/> );   
  10  
  11  
  12  
  13  
  14  
  15  
  16  
  17foreach (@progs_to_search) {   
  18  
  19  
  20  
  21  
  22  
  23  
  24  
  25$filetotest = "$lbdir" . "$_";   
  26  
  27  
  28  
  29if (-e $filetotest) {   
  30  
  31  
  32  
  33open (TEST, "$filetotest");   
  34  
  35  
  36  
  37@testfile = <test>;   
  38  
  39  
  40  
  41close (TEST);   
  42  
  43  
  44  
  45if (grep(/\r/, @testfile) &amp;&amp; $^O ne "MSWin32") {   
  46  
  47  
  48  
  49print "<b>找到 $_ ,但它好像是以 BINARY 方式上传的。请重新以 ASCII 方式上传!</b><br/>";   
  50  
  51  
  52  
  53}   
  54  
  55  
  56  
  57else { print "找到 $_ - 上传正确!<br/>"; }   
  58  
  59  
  60  
  61}   
  62  
  63  
  64  
  65else { print "<b>找不到 $_ ! - 是否上传了?</b><br/>"; }   
  66  
  67  
  68  
  69  
  70  
  71  
  72  
  73} # end foreach   
  74  
  75  
  76  
  77$server_port = ":$ENV{'SERVER_PORT'}" if ($ENV{'SERVER_PORT'} ne '80');   
  78  
  79  
  80  
  81if ($ENV{'HTTP_HOST'} ne "") { $fullurl = $ENV{'HTTP_HOST'}; } else { $fullurl = $ENV{'SERVER_NAME'}; }   
  82  
  83  
  84  
  85$fullurl = "http://$fullurl$server_port$ENV{'SCRIPT_NAME'}";   
  86  
  87  
  88  
  89$myurl = substr($fullurl,0,rindex($fullurl,"/"));   
  90  
  91  
  92  
  93$geturl="http://www.leoboard.com/cgi-bin/lbver.cgi?ver=LB5000&amp;url=$myurl";   
  94  
  95  
  96  
  97  
  98  
  99  
 100  
 101$out=&amp;lbagent($geturl);   
 102  
 103  
 104  
 105  
 106  
 107  
 108  
 109print qq(   
 110  
 111  
 112  
 113<br/>
 114<hr color="#000000" noshade=""/>
 115<font color="#0000FF" face="宋体">
 116<br/><b>报告结束</b></font>
 117<br/>
 118<br/>
 119<font color="#000000" face="宋体">   
 120  
 121  
 122  
 123LB5000 MX 安装向导已经完成报告。如果您发现错误,请返回重新填写信息。   
 124  
 125  
 126  
 127<br/>同时,您也可以使用管理员身份在任何时间重新填写信息。   
 128  
 129  
 130  
 131<br/><br/>   
 132  
 133  
 134  
 135如果您不确定一些问题,或者出现一些未知的错误,请到 <a href="http://www.cgier.com/"><b>CGI 编程者之家</b></a> 的论坛中提出!   
 136  
 137  
 138  
 139<br/><br/><i>报告结束</i>
 140<br/><br/>
 141<hr color="#000000" noshade=""/>
 142<font color="#0000FF" face="宋体">
 143<br/><b>下一步做什么?</b></font>
 144<br/>
 145<br/>
 146<font color="#000000" face="宋体">
 147<b>如果您是从 LB5000 MX 的早期版本升级的,<a href="admincenter.cgi?action=remove">现在到管理中心界面</a></b>!   
 148  
 149  
 150  
 151<br/><br/>从安全性上考虑,当你进入管理中心的同时,本安装文件将会被自动删除。<br/>   
 152  
 153  
 154  
 155当本安装文件存在的时候,管理中心是不能运行的!如果自动删除失败,那么请你自行利用 FTP 来删除这个本程序!   
 156  
 157  
 158  
 159<br/><br/>
 160<b>如果你是第一次安装 LB5000 MX,那么请<a href="$thisprog?action=step_three">点击这里进入第三步</a></b>!</font>
 161<br/><br/><br/><br/><br/>   
 162  
 163  
 164  
 165);   
 166  
 167  
 168  
 169  
 170  
 171  
 172  
 173}   
 174  
 175  
 176  
 177  
 178  
 179  
 180  
 181  
 182  
 183  
 184  
 185elsif ($action eq "step_three") {   
 186  
 187  
 188  
 189  
 190  
 191  
 192  
 193print qq(   
 194  
 195  
 196  
 197<font color="#000000" face="宋体" size="5">
 198<h1>LB5000 MX 安装向导</h1></font><font color="#000000" face="宋体">   
 199  
 200  
 201  
 202程序编制:<a href="mailto:webmaster\@cgier.com">山鹰糊</a> 参与制作:<a href="mailto:info\@cgier.net">花无缺</a><br/>   
 203  
 204  
 205  
 206版权所有:<a href="http://www.cgier.com/">CGI 编程者之家</a></font>
 207<hr color="#000000" noshade=""/>
 208<br/>
 209<font color="#FF0000" face="宋体">
 210<b>你是否以前到过这一步?</b>
 211<br/><br/>
 212<font color="#000000" face="宋体">
 213<b>如果您是从 LB5000 MX 的早期版本升级的,<a href="admincenter.cgi?action=remove">现在到管理中心界面</a></b>!   
 214  
 215  
 216  
 217<br/><br/>如果您运行这一步,您将<b>丢失</b>论坛的所有数据!!!   
 218  
 219  
 220  
 221<hr color="#000000" noshade=""/>
 222<br/>
 223<b>第三步:</b><br/>   
 224  
 225  
 226  
 227最后安装部分。这一步将完成论坛的安装,您将能够进入管理中心界面设置论坛风格、颜色等。   
 228  
 229  
 230  
 231<br/>
 232<hr color="#000000" noshade=""/>
 233<br/>
 234<font color="#0000FF" face="宋体">
 235<b>以管理员身份注册您自己</b></font>
 236<br/><br/>
 237<font color="#000000" face="宋体">   
 238  
 239  
 240  
 241您将以管理员身份注册自己,这样就可以正确访问管理中心界面</font>
 242<br/><br/>
 243<form action="$thisprog" method="post">
 244<input name="action" type="hidden" value="final_step"/>
 245<font color="#000000" face="宋体">   
 246  
 247  
 248  
 249输入您的管理员名称:(最大12字符)<br/>
 250<input maxlength="12" name="membername" type="text"/>
 251<br/><br/>   
 252  
 253  
 254  
 255请输入管理员密码:<br/>
 256<input maxlength="20" name="password_one" type="password"/>
 257<br/><br/>   
 258  
 259  
 260  
 261请重输管理员密码:<br/>
 262<input maxlength="20" name="password_two" type="password"/>
 263<br/><br/>
 264<input type="submit" value="提 交 这 个 信 息"/>
 265</font></form>
 266<hr color="#000000" noshade=""/>
 267<br/>
 268<b>请仔细检查所有信息,并请紧记您的名称、密码。</b>
 269<br/><br/> );   
 270  
 271  
 272  
 273  
 274  
 275  
 276  
 277} # end step 3   
 278  
 279  
 280  
 281  
 282  
 283  
 284  
 285elsif ($action eq "final_step") {   
 286  
 287  
 288  
 289  
 290  
 291  
 292  
 293$namecookie = cookie(-name =&gt; "adminname",   
 294  
 295  
 296  
 297-value =&gt; "$membername");   
 298  
 299  
 300  
 301  
 302  
 303  
 304  
 305$passcookie = cookie(-name =&gt; "adminpass",   
 306  
 307  
 308  
 309-value =&gt; "$password_one");   
 310  
 311  
 312  
 313  
 314  
 315  
 316  
 317print header(-cookie=&gt;[$namecookie, $passcookie],-charset=&gt;"gb2312"); print "<head><title>LB5000 MX 安装向导 -- CGI 编程者之家</title></head>$stylesheet<body>";   
 318  
 319  
 320  
 321  
 322  
 323  
 324  
 325print qq(   
 326  
 327  
 328  
 329<font color="#000000" face="宋体" size="5">
 330<h1>LB5000 MX 安装向导</h1></font><font color="#000000" face="宋体">   
 331  
 332  
 333  
 334程序编制:<a href="mailto:webmaster\@cgier.com">山鹰糊</a> 参与制作:<a href="mailto:info\@cgier.net">花无缺</a><br/>   
 335  
 336  
 337  
 338版权所有:<a href="http://www.cgier.com/">CGI 编程者之家</a></font>
 339<hr color="#000000" noshade=""/>
 340<br/>
 341<font color="#000000" face="宋体">
 342<b>欢迎使用 LB5000 MX 安装向导!</b>
 343<br/><br/>
 344<b>最后一步:</b><br/>   
 345  
 346  
 347  
 348LB5000 MX 安装向导现在建立您的管理员账号。   
 349  
 350  
 351  
 352<br/>
 353<hr color="#000000" noshade=""/>
 354<br/>   
 355  
 356  
 357  
 358);   
 359  
 360  
 361  
 362  
 363  
 364  
 365  
 366require "${lbdir}data/boardinfo.cgi";   
 367  
 368  
 369  
 370  
 371  
 372  
 373  
 374$currenttime = time;   
 375  
 376  
 377  
 378$blanks = "yes" if (!$membername);   
 379  
 380  
 381  
 382$blanks = "yes" if (!$password_one);   
 383  
 384  
 385  
 386$blanks = "yes" if (!$password_two);   
 387  
 388  
 389  
 390  
 391  
 392  
 393  
 394if ($blanks) { print qq(<br/><br/><font color="#FF0000">请填写完所有选项,使用后退返回上一步。); print "</font></font></body>"; exit; }   
 395  
 396  
 397  
 398if ($password_one ne $password_two) { print qq(<br/><br/><font color="#FF0000">输入的两次密码不同,请返回上一步重新输入。); print ""; exit; }   
 399  
 400  
 401  
 402if(length($membername)&lt;2) { print qq(<br/><br/><font color="#ff0000">管理员用户名太短了!); print ""; exit; }   
 403  
 404  
 405  
 406if($membername =~ /^客人/) { print qq(<br/><br/><font color="#ff0000">管理员用户名不能为客人字样!);print "";exit; }   
 407  
 408  
 409  
 410if($membername =~ /_/) { print qq(<br/><br/><font color="#ff0000">请不要在管理员帐号名中使用下划线!); print "";exit;}   
 411  
 412  
 413  
 414if($membername =~ /\t/) { print qq(<br/><br/><font color="#ff0000">请不要在管理员帐号名中使用特殊字符!);print "";exit; }   
 415  
 416  
 417  
 418if(($password_one =~ /\t/)||($password_two =~ /\t/)) { print qq(<br/><br/><font color="#ff0000">请不要在密码中使用特殊字符!); print "";exit;}   
 419  
 420  
 421  
 422if(length($password_one)&lt;6) { print qq(<br/><br/><font color="#ff0000">管理员密码太短了,请更换!密码必须 6 位以上!); print "";exit;}   
 423  
 424  
 425  
 426if ($password_one =~ /^[0-9]+$/) { print qq(<br/><br/><font color="#ff0000">管理员密码请不要全部为数字,请更换!); print "";exit;}   
 427  
 428  
 429  
 430if ($password_one =~ /[^a-zA-Z0-9]/) { print qq(<br/><br/><font color="#ff0000">管理员密码只允许大小写字母和数字的组合,请更换!); print "";exit;}   
 431  
 432  
 433  
 434  
 435  
 436  
 437  
 438opendir (DIRS, "$lbdir");   
 439  
 440  
 441  
 442my @files2 = readdir(DIRS);   
 443  
 444  
 445  
 446closedir (DIRS);   
 447  
 448  
 449  
 450my @memdir = grep(/^members/i, @files2);   
 451  
 452  
 453  
 454$memdir = $memdir[0];   
 455  
 456  
 457  
 458  
 459  
 460  
 461  
 462$memberfilename = $membername;   
 463  
 464  
 465  
 466$memberfilename =~ y/ /_/;   
 467  
 468  
 469  
 470$memberfilename =~ tr/A-Z/a-z/;   
 471  
 472  
 473  
 474$membersdir = "$lbdir" . "$memdir";   
 475  
 476  
 477  
 478  
 479  
 480  
 481  
 482$filetomake = "$lbdir" . "$memdir/$memberfilename.cgi";   
 483  
 484  
 485  
 486  
 487  
 488  
 489  
 490open (ADMIN, "&gt;$filetomake");   
 491  
 492  
 493  
 494print ADMIN "$membername\t$password_one\tmember\tad\t0\t$adminemail_in\tno\t保密\t\t\t\t\t\t$currenttime\t\t";   
 495  
 496  
 497  
 498close (ADMIN);   
 499  
 500  
 501  
 502  
 503  
 504  
 505  
 506if (-e $filetomake) {   
 507  
 508  
 509  
 510$filerequire = "$lbdir"."data/boardinfo.cgi";   
 511  
 512  
 513  
 514if (-e $filerequire) {   
 515  
 516  
 517  
 518}else {   
 519  
 520  
 521  
 522print qq(   
 523  
 524  
 525  
 526<font color="#FF0000" face="宋体">
 527<b>错误!不能够找到 $filerequire 文件!</b>
 528<br/><br/>   
 529  
 530  
 531  
 532请检查 data 目录属性是否正确: $lbdir/data );   
 533  
 534  
 535  
 536print ""; exit;   
 537  
 538  
 539  
 540}   
 541  
 542  
 543  
 544  
 545  
 546  
 547  
 548print qq(   
 549  
 550  
 551  
 552<font color="#000000" face="宋体">
 553<b>恭喜,您的 LB5000 MX 已经成功安装好了!</b>
 554<br/><br/>   
 555  
 556  
 557  
 558现在,您可以<a href="admincenter.cgi?action=remove">进入管理中心</a>设置您的论坛。<br/>从安全角度考虑,本自动安装程序将会被自动删除,以免您的论坛受到不安全的威胁!<br/>   
 559  
 560  
 561  
 562同时我们已经安装了两个论坛附加功能:<br/>   
 563  
 564  
 565  
 5661\. LB5000 MX 论坛新新贴子,显示整个论坛的最新贴 ver 1.2<br/>   
 567  
 568  
 569  
 570############################################################################<br/>   
 571  
 572  
 573  
 574# 使用办法: allnews.cgi&amp;maxlength=标题长度<br/>   
 575  
 576  
 577  
 578# 例: 在你主页的适当位置加入以下语句<br/>   
 579  
 580  
 581  
 582# &lt;script src="$boardurl/allnews.cgi&amp;maxlength=20&amp;display=1"&gt;&lt;/script&gt;<br/>   
 583  
 584  
 585  
 586# 这样就可以在相应位置显示整个论坛的最新贴,标题长度 20,显示发贴时间<br/>   
 587  
 588  
 589  
 590# (display=0 表示不显示发贴时间)<br/>   
 591  
 592  
 593  
 594# <br/>   
 595  
 596  
 597  
 598# 对于显示贴子个数,请在 LB5000 MX 中的管理区设置<br/>   
 599  
 600  
 601  
 602# 所有参数均可以省略<br/>   
 603  
 604  
 605  
 606############################################################################<br/>   
 607  
 608  
 609  
 6102\. LB5000 MX 分论坛新新贴子 ver 1.2<br/>   
 611  
 612  
 613  
 614###################################################################################<br/>   
 615  
 616  
 617  
 618# 使用办法: news.cgi?forum=分论坛号&amp;max=显示几条贴子&amp;maxlength=标题长度&amp;display=1<br/>   
 619  
 620  
 621  
 622# 例: 在你主页的适当位置加入以下语句<br/>   
 623  
 624  
 625  
 626# &lt;script src="$boardurl/news.cgi?forum=1&amp;max=10&amp;maxlength=20"&gt;&lt;/script&gt;<br/>   
 627  
 628  
 629  
 630# 这样就可以在相应位置显示1号论坛的最新10个贴子,标题长度为 20,显示发贴时间<br/>   
 631  
 632  
 633  
 634# (display=0 表示不显示发贴时间)<br/>   
 635  
 636  
 637  
 638# 所有参数均可以省略<br/>   
 639  
 640  
 641  
 642###################################################################################<br/>   
 643  
 644  
 645  
 6463\. LB5000 MX 分论坛精华贴子显示 ver 1.2<br/>   
 647  
 648  
 649  
 650###################################################################################<br/>   
 651  
 652  
 653  
 654# 使用办法: newsjh.cgi?forum=分论坛号<br/>   
 655  
 656  
 657  
 658# 例: 在你主页的适当位置加入以下语句<br/>   
 659  
 660  
 661  
 662# &lt;script src="newsjh.cgi?forum=1"&gt;&lt;/script&gt;<br/>   
 663  
 664  
 665  
 666# 这样就可以在相应位置显示1号论坛的最新20个贴子<br/>   
 667  
 668  
 669  
 670###################################################################################<br/>   
 671  
 672  
 673  
 6744\. LB5000 MX 公告显示 ver 1.2<br/>   
 675  
 676  
 677  
 678###################################################################################<br/>   
 679  
 680  
 681  
 682# 使用办法: getanc.cgi<br/>   
 683  
 684  
 685  
 686# 例: 在你主页的适当位置加入以下语句<br/>   
 687  
 688  
 689  
 690# &lt;script src="getanc.cgi"&gt;&lt;/script&gt;<br/>   
 691  
 692  
 693  
 694# 这样就可以在相应位置显示论坛的最新公告<br/>   
 695  
 696  
 697  
 698###################################################################################<br/>
 699<br/><br/>   
 700  
 701  
 702  
 703还有8个附加功能存放在 addon 目录中,是<br/>   
 704  
 705  
 706  
 7071\. bm2lb5000.cgi "UBB=&gt;LB5000 MX 用户资料转换器"<br/>   
 708  
 709  
 710  
 7112\. ubb2lb5000.cgi "bm=&gt;LB5000 MX 用户数据转换 v0.2" <br/>   
 712  
 713  
 714  
 7153\. yuzi2lb5000.cgi "yuzi BBS2000(3000)=&gt;LB5000 MX 用户资料转换器"<br/>   
 716  
 717  
 718  
 7194\. ys2lb5000.cgi "一山草堂 BBS=&gt;LB5000 MX 用户资料转换器"<br/>   
 720  
 721  
 722  
 7235\. yaBB2LB5000.cgi "YaBB=&gt;LB5000 MX 用户资料转换器"<br/>   
 724  
 725  
 726  
 7276\. bbs2lbt.cgi "yuzi BBS3000=&gt;LB5000 MX 贴子资料转换器"<br/>   
 728  
 729  
 730  
 7317\. ys2lbt.cgi "一山草堂 BBS=&gt;LB5000 MX 贴子资料转换器"<br/>   
 732  
 733  
 734  
 7358\. u2lbt.cgi "UBB=&gt;LB5000 MX 贴子资料转换器"<br/>   
 736  
 737  
 738  
 739);   
 740  
 741  
 742  
 743}   
 744  
 745  
 746  
 747else {   
 748  
 749  
 750  
 751print qq(   
 752  
 753  
 754  
 755<font color="#FF0000" face="宋体">
 756<b>错误!不能够建立 admin 文件!</b>
 757<br/><br/>   
 758  
 759  
 760  
 761请检查 $memdir 目录是否正确: $membersdir );   
 762  
 763  
 764  
 765print ""; exit;   
 766  
 767  
 768  
 769}   
 770  
 771  
 772  
 773  
 774  
 775  
 776  
 777$filetomake = "$lbdir" . "data/boardstats.cgi";   
 778  
 779  
 780  
 781  
 782  
 783  
 784  
 785  
 786  
 787  
 788  
 789  
 790  
 791  
 792  
 793open(FILE, "&gt;$filetomake");   
 794  
 795  
 796  
 797print FILE "\$lastregisteredmember = '$membername'\;\n";   
 798  
 799  
 800  
 801print FILE "\$totalmembers = '1'\;\n";   
 802  
 803  
 804  
 805print FILE "\$totalthreads = '0'\;\n";   
 806  
 807  
 808  
 809print FILE "\$totalposts = '0'\;\n";   
 810  
 811  
 812  
 813print FILE "\n1\;";   
 814  
 815  
 816  
 817close (FILE);   
 818  
 819  
 820  
 821  
 822  
 823  
 824  
 825print qq(   
 826  
 827  
 828  
 829<br/><br/>
 830<hr color="#000000" noshade=""/>
 831<font color="#0000FF" face="宋体">   
 832  
 833  
 834  
 835感谢你使用 LB5000 MX!</font>
 836<br/><br/>
 837<font color="#000000" face="宋体">   
 838  
 839  
 840  
 841我们希望安装向导对您安装本论坛是有帮助的。<br/>   
 842  
 843  
 844  
 845如果您还有其他问题,请参观 <a href="http://www.cgier.com/"><b>CGI 编程者之家</b></a> 的论坛,本站提供 LB5000 MX 的完全技术支持!   
 846  
 847  
 848  
 849<br/><br/>   
 850  
 851  
 852  
 853);   
 854  
 855  
 856  
 857  
 858  
 859  
 860  
 861} # end final step   
 862  
 863  
 864  
 865  
 866  
 867  
 868  
 869  
 870  
 871  
 872  
 873else {   
 874  
 875  
 876  
 877if ($ENV{'SERVER_SOFTWARE'} =~ /apache/i) {   
 878  
 879  
 880  
 881if ($ENV{'SCRIPT_FILENAME'}=~ /cgiwrap/i) {   
 882  
 883  
 884  
 885$temp=$ENV{'PATH_TRANSLATED'};   
 886  
 887  
 888  
 889}   
 890  
 891  
 892  
 893else {   
 894  
 895  
 896  
 897$temp=$ENV{'SCRIPT_FILENAME'};   
 898  
 899  
 900  
 901}   
 902  
 903  
 904  
 905$temp=~ s/\\\/\//g if ($temp=~/\\\/);   
 906  
 907  
 908  
 909$mypath=substr($temp,0,rindex($temp,"/"));   
 910  
 911  
 912  
 913}   
 914  
 915  
 916  
 917else {   
 918  
 919  
 920  
 921$mypath=substr($ENV{'PATH_TRANSLATED'},0,rindex($ENV{'PATH_TRANSLATED'},"\\\"));   
 922  
 923  
 924  
 925$mypath=~ s/\\\/\//g;   
 926  
 927  
 928  
 929}   
 930  
 931  
 932  
 933$server_port = ":$ENV{'SERVER_PORT'}" if ($ENV{'SERVER_PORT'} ne '80');   
 934  
 935  
 936  
 937if ($ENV{'HTTP_HOST'} ne "") { $fullurl = $ENV{'HTTP_HOST'}; } else { $fullurl = $ENV{'SERVER_NAME'}; }   
 938  
 939  
 940  
 941$fullurl = "http://$fullurl$server_port$ENV{'SCRIPT_NAME'}";   
 942  
 943  
 944  
 945$myurl = substr($fullurl,0,rindex($fullurl,"/"));   
 946  
 947  
 948  
 949  
 950  
 951  
 952  
 953$website_url = "http://$ENV{'HTTP_HOST'}";   
 954  
 955  
 956  
 957  
 958  
 959  
 960  
 961$html_dir = "";   
 962  
 963  
 964  
 965$html_url = "";   
 966  
 967  
 968  
 969  
 970  
 971  
 972  
 973if ($mypath =~ m|(.*)/(.+)|) {   
 974  
 975  
 976  
 977$base = $1;   
 978  
 979  
 980  
 981} else {   
 982  
 983  
 984  
 985$base = $mypath;   
 986  
 987  
 988  
 989}   
 990  
 991  
 992  
 993  
 994  
 995  
 996  
 997if ($myurl =~ m|(.*)/(.+)|) {   
 998  
 999  
1000  
1001$base1 = $1;   
1002  
1003  
1004  
1005} else {   
1006  
1007  
1008  
1009$base1 = $myurl;   
1010  
1011  
1012  
1013}   
1014  
1015  
1016  
1017$base1 =~ s/\/cgi-bin//;   
1018  
1019  
1020  
1021if ((-e "$base/non-cgi/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/non-cgi"; $html_url = "$base1/non-cgi"; }   
1022  
1023  
1024  
1025if ((-e "$base/lb5000/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/lb5000"; $html_url = "$base1/lb5000"; }   
1026  
1027  
1028  
1029if ((-e "$base/ib2000/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/ib2000"; $html_url = "$base1/ib2000"; }   
1030  
1031  
1032  
1033if ((-e "$base/lb/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/lb"; $html_url = "$base1/lb"; }   
1034  
1035  
1036  
1037if ((-e "$base/bbs/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/bbs"; $html_url = "$base1/bbs"; }   
1038  
1039  
1040  
1041  
1042  
1043  
1044  
1045if ($html_dir eq "") {   
1046  
1047  
1048  
1049if ($base =~ m|(.*)/(.+)|) {   
1050  
1051  
1052  
1053$base = $1;   
1054  
1055  
1056  
1057}   
1058  
1059  
1060  
1061if ($base1 =~ m|(.*)/(.+)|) {   
1062  
1063  
1064  
1065$base1 = $1;   
1066  
1067  
1068  
1069} else {   
1070  
1071  
1072  
1073$base1 = $base1;   
1074  
1075  
1076  
1077}   
1078  
1079  
1080  
1081$base1 =~ s/\/cgi-bin//;   
1082  
1083  
1084  
1085  
1086  
1087  
1088  
1089if ((-e "$base/non-cgi/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/non-cgi"; $html_url = "$base1/non-cgi"; }   
1090  
1091  
1092  
1093if ((-e "$base/lb5000/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/lb5000"; $html_url = "$base1/lb5000"; }   
1094  
1095  
1096  
1097if ((-e "$base/ib2000/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/ib2000"; $html_url = "$base1/ib2000"; }   
1098  
1099  
1100  
1101if ((-e "$base/lb/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/lb"; $html_url = "$base1/lb"; }   
1102  
1103  
1104  
1105if ((-e "$base/bbs/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/bbs"; $html_url = "$base1/bbs"; }   
1106  
1107  
1108  
1109}   
1110  
1111  
1112  
1113  
1114  
1115  
1116  
1117if ($html_dir eq "") {   
1118  
1119  
1120  
1121if ($ENV{'DOCUMENT_ROOT'} ne "") {   
1122  
1123  
1124  
1125$base = $ENV{'DOCUMENT_ROOT'};   
1126  
1127  
1128  
1129if ((-e "$base/non-cgi/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/non-cgi"; $html_url = "$website_url/non-cgi"; }   
1130  
1131  
1132  
1133if ((-e "$base/lb5000/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/lb5000"; $html_url = "$website_url/lb5000"; }   
1134  
1135  
1136  
1137if ((-e "$base/ib2000/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/ib2000"; $html_url = "$website_url/ib2000"; }   
1138  
1139  
1140  
1141if ((-e "$base/lb/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/lb"; $html_url = "$website_url/lb"; }   
1142  
1143  
1144  
1145if ((-e "$base/bbs/index.html")&amp;&amp;($html_dir eq "")) { $html_dir = "$base/bbs"; $html_url = "$website_url/bbs"; }   
1146  
1147  
1148  
1149}   
1150  
1151  
1152  
1153}   
1154  
1155  
1156  
1157  
1158  
1159  
1160  
1161if (-e "C:/" || $^O eq "MSWin32") { $OS_USED = 'NT'; }   
1162  
1163  
1164  
1165$adminemail_in = "incoming\@yourdomain.com";   
1166  
1167  
1168  
1169$adminemail_out = "outgoing\@yourdomain.com";   
1170  
1171  
1172  
1173$timezone_choice = "<select name='\"timezone\"'><option value='\"-23\"'>\- 23<option value='\"-22\"'>\- 22<option value='\"-21\"'>\- 21<option value='\"-20\"'>\- 20<option value='\"-19\"'>\- 19<option value='\"-18\"'>\- 18<option value='\"-17\"'>\- 17<option value='\"-16\"'>\- 16<option value='\"-15\"'>\- 15<option value='\"-14\"'>\- 14<option value='\"-13\"'>\- 13<option value='\"-12\"'>\- 12<option value='\"-11\"'>\- 11<option value='\"-10\"'>\- 10<option value='\"-9\"'>\- 9<option value='\"-8\"'>\- 8<option value='\"-7\"'>\- 7<option value='\"-6\"'>\- 6<option value='\"-5\"'>\- 5<option value='\"-4\"'>\- 4<option value='\"-3\"'>\- 3<option value='\"-2\"'>\- 2<option value='\"-1\"'>\- 1<option selected="" value='\"0\"'>0<option value='\"1\"'>\+ 1<option value='\"2\"'>\+ 2<option value='\"3\"'>\+ 3<option value='\"4\"'>\+ 4<option value='\"5\"'>\+ 5<option value='\"6\"'>\+ 6<option value='\"7\"'>\+ 7<option value='\"8\"'>\+ 8<option value='\"9\"'>\+ 9<option value='\"10\"'>\+ 10<option value='\"11\"'>\+ 11<option value='\"12\"'>\+ 12<option value='\"13\"'>\+ 13<option value='\"14\"'>\+ 14<option value='\"15\"'>\+ 15<option value='\"16\"'>\+ 16<option value='\"17\"'>\+ 17<option value='\"18\"'>\+ 18<option value='\"19\"'>\+ 19<option value='\"20\"'>\+ 20<option value='\"21\"'>\+ 21<option value='\"22\"'>\+ 22<option value='\"23\"'>\+ 23</option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></option></select>";   
1174  
1175  
1176  
1177$time_is_now = localtime;   
1178  
1179  
1180  
1181$website_url = "http://$ENV{'HTTP_HOST'}";   
1182  
1183  
1184  
1185$mailprogram = &amp;mailprogram #自动测试 Sendmail 路径   
1186  
1187  
1188  
1189print qq~   
1190  
1191  
1192  
1193<form action="$thisprog" method="post">
1194<input name="action" type="hidden" value="step_two"/>
1195<font color="#000000" face="宋体" size="5">
1196<h1>LB5000 MX 安装向导</h1></font><font color="#000000" face="宋体">   
1197  
1198  
1199  
1200程序编制:<a href="mailto:webmaster\@cgier.com">山鹰糊</a> 参与制作:<a href="mailto:info\@cgier.net">花无缺</a><br/>   
1201  
1202  
1203  
1204版权所有:<a href="http://www.cgier.com/">CGI 编程者之家</a></font>
1205<hr color="#000000" noshade=""/>
1206<br/>
1207<font color="#000000" face="宋体">
1208<b>欢迎使用 LB5000 MX 安装向导!</b>
1209<br/><br/>
1210<b>第一步:</b> 在递交表单前,请仔细查看整个下面的内容指示,并检查自动提供的数据是否正确!<br/>   
1211  
1212  
1213  
1214当你递交表单后,本安装向导会检测所有你输入的数据,如果数据输入错误,将会有详细的提示!<br/><br/>
1215<b>在执行本程序下一步之前,请确定你已经把本程序完整上传,并已经将所有文件的属性设置正确了!</b><br/><br/>   
1216  
1217  
1218  
1219下面的所有设置数据都可以在 LB5000 MX 的管理中心中重新设置。为了安全起见,本程序在成功完成设置任务后,将会自毁。   
1220  
1221  
1222  
1223如果你希望重新利用本程序来设置的话,请重新上传运行本程序。</font><br/>
1224<hr color="#000000" noshade=""/>
1225<br/>
1226<font color="#000000" face="宋体">
1227<b>请选择运行本程序的操作系统平台用于文件加锁</b><br/>   
1228  
1229  
1230  
1231如果你是 Windows 系列的主机,请千万不要选成 Unix,否则会有意想不到的错误发生!<br/>   
1232  
1233  
1234  
1235文件加锁可以有效的防止贴子数据丢失等问题,但会影响速度,请自己衡量!<br/>
1236<br/>
1237<select name="OS_USED">
1238<option selected="" value="NT">Windows 系列   
1239  
1240  
1241  
1242<option value="Unix">Unix 系列   
1243  
1244  
1245  
1246<option value="No">不加锁   
1247  
1248  
1249  
1250</option></option></option></select>
1251<br/>
1252<br/>
1253<hr color="#000000" noshade=""/>
1254<br/>
1255<font color="#000000" face="宋体">
1256<b>文件路径设置</b><br/><br/>   
1257  
1258  
1259  
1260下面的默认设置仅仅适用于大部分安装本程序的客户,不是所有的客户都适用。如果有错误,请自行修改成正确的值。<font color="#FF0000"><br/>   
1261  
1262  
1263  
1264请仔细检查所有的设置,如果你对这些设置有任何的疑问,请询问你的主机提供商!</font><br/><br/>
1265<font color="#FF0000">如果你使用的是 Windows 系列操作系统,请使用除号来代替反斜杠(比如:c:/path/to/lb5000/)!   
1266  
1267  
1268  
1269<br/><br/><font color="#000000"><b>设置时请务必在路径的最后加上除号 '/'。</b>
1270<br/><br/>
1271<font color="#0000FF" face="宋体">
1272<b>设置 *.cgi 脚本的安装路径。</b></font><br/>
1273<font color="#000000" face="宋体">   
1274  
1275  
1276  
1277在这里设置的是安装“路径”,不是 URL,所以它肯定<b>不是</b> 'http://' 开头的。<br/>   
1278  
1279  
1280  
1281这个位置包含了所有 LB5000 MX 中的 *.cgi 文件。   
1282  
1283  
1284  
1285要注意,下列目录程序会自动建立。   
1286  
1287  
1288  
1289<ul>
1290<li>data   
1291  
1292  
1293  
1294<li>members   
1295  
1296  
1297  
1298<li>messages   
1299  
1300  
1301  
1302</li></li></li></ul>
1303<input name="lbdir" size="70" type="text" value="$mypath/"/>
1304<br/><br/><br/>
1305<font color="#0000FF" face="宋体">
1306<b>设置 image 图像文件的安装路径。</b></font><br/><br/>
1307<font color="#000000" face="宋体">   
1308  
1309  
1310  
1311在这里设置的是安装“路径”,不是 URL,所以它肯定<b>不是</b> 'http://' 开头的。<br/>   
1312  
1313  
1314  
1315这个位置包含了所有 LB5000 MX 中的图像文件。   
1316  
1317  
1318  
1319要注意,下列目录程序会自动建立。   
1320  
1321  
1322  
1323<ul>
1324<li>images   
1325  
1326  
1327  
1328<li>avatars   
1329  
1330  
1331  
1332<li>usravatars   
1333  
1334  
1335  
1336</li></li></li></ul>
1337<b>请注意,<b>不要</b>在路径的最后加 'images/' !</b><br/><br/>
1338<input name="imagesdir" size="70" type="text" value="$html_dir/"/>
1339<br/><br/>
1340<hr color="#000000" noshade=""/>
1341<br/>
1342<font color="#000000" face="宋体">
1343<b>设置你网站的 URL 路径</b><br/><br/>   
1344  
1345  
1346  
1347下面的默认设置仅仅适用于大部分安装本程序的客户,不是所有的客户都适用。如果有错误,请自行修改成正确的值。<font color="#FF0000"><br/>   
1348  
1349  
1350  
1351请仔细检查所有的设置,如果你对这些设置有任何的疑问,请询问你的主机提供商!</font><br/><br/>
1352<b>请不要在每个 URL 地址结尾加反斜杠 '/' !</b>
1353<br/><br/>
1354<font color="#0000FF" face="宋体">
1355<b>设置图片文件 URL 路径。</b></font><br/>
1356<font color="#000000" face="宋体">   
1357  
1358  
1359  
1360这里是 URL 路径。<b>必须</b>以 'http://' 开始。<br/>   
1361  
1362  
1363  
1364这个路径包含了所有的 LB5000 MX 图片。   
1365  
1366  
1367  
1368<br/><br/></font></font></font></font></font></font></font></font></form></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></test></font>
Published At
Categories with 服务器类
Tagged with
comments powered by Disqus