亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2266 | 回復: 6
打印 上一主題 下一主題

這個CGI程序是怎么回事? [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2005-06-05 21:31 |只看該作者 |倒序瀏覽
#!/usr/bin/perl
use strict;
use warnings;
use CGI::Thin;
use CGI::Carp qw(fatalsToBrowser);
use HTML::Entities;

my $out_dir="/tmp";    #我不知道這里該用什么??windows下不是用\作分 # 隔符的嗎?
sub debug()
{
   print "<H1>;DEBUG INFORMATION</H1>;\n";
   print "<H2>;Form  INformation</H2>;\n";

   my %form_info=Parse_CGI();
   foreach my $cur_key ( sort keys %form_info)
   {
     print "
;";
     if (ref $form_info{$cur_key})
     {
     foreach my $value (@{$form_info{$cur_key}})
     {
       print encode_entities($cur_key),"=",
             encode_entities($value),"\n";
     }
     } else
         {
         print encode_entities($cur_key),"=",
               encode_entities($form_info{$cur_key}),"\n";
         }
   }

   print "<H2>;Enviroment</H2>;\n";
   foreach my $cur_key ( sort keys %ENV)
   {
   print "
;";
   print encode_entities($cur_key),"=",
         encode_entities($ENV{$cur_key}),"\n";
   }
}
sub write_report()
{
   my %form_info=Parse_CGI();
   my $time=time();
   open OUT_FILE,">;$out_dir/form.$time" or
     die "could not open $out_dir/form.$time";

     print OUT_FILE "Nameform_info{name}
                     Group: $form_info{group}\n";
     if ($form_info{work})
     {
     print OUT_FILE "Full Time Employee\n";
     }
     if ($form_info{intern})
     {
      print OUT_FILE "art of the Intern program\n";
     }
     if (not defined ($form_info{schedule}))
     {
     print OUT_FILE "***Did not select a schedule\n";
     } else {
      print OUT_FILE "Scheduleform_info{schedule}\n";
      }
      print OUT_FILE "Comments:\n";
      print OUT_FILE "$form_info{comments}\n";
      close OUT_FILE ;
}

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

debug();
write_report();
print <<EOF;
<H1>;Thanks</H1>;
<p>;
Thank you for your time.
EOF
我用OptiPerl4.3它給出的提示是:
OptiPerl Server Warning
This script does not output it's mime type. It does not print something like:
print "Content-type: text/html\n\n";
The way this script output's it's header will not work on a real server! Here is the complete header:

[Sun Jun 5 21:13:21 2005] survey.pl: could not open /tmp/form.1117977201 at D:\Program Files\OptiPerl\Webroot\cgi-bin\survey.pl line 45.
Content-type:text/html
可是我看了后,還是不明白,求高手指點.
這是那個網(wǎng)頁:
<head>;
    <title>;Survey</title>;
</head>;
<body>;
  <center>;<h1>lease fill in our survey</h1>;</center>;
<form  action="/cgi-bin/survey.pl"  method="post">;
<p>;
Name:
<input  type="text" NAME="name"  size=30>;

;
Group:
<Select NAME="group"  Size=1>;
     <option>;Software</option>;
     <option>;Marketing</option>;
     <option>;Support</option>;
</select>;

;
   <input type="checkbox" name="work" value="1"   checked>;
Full time employee
   </input>;

;
  <input  type="checkbox" name="intern" value="1">;
     Current a member of an intern program
  </input>;

;
<p>;
  I believe that my current project will be completed:

;
<INPUT type="radio" name="schedule" value="early">;
  Early
</input>;
<input type="radio"  name="schedule" value="ontime">;
On time
</input>;
<p>;
comments:

;
<textarea name="comments" cols=35 rows=4>;
Replace this with your comments.
</textarea>;
<input type="hidden" name="version" value="1.0">;

;
<input type="submit" value="Submit Form">;
</form>;
</body>;
</html>;

論壇徽章:
1
2015年辭舊歲徽章
日期:2015-03-03 16:54:15
2 [報告]
發(fā)表于 2005-06-06 09:26 |只看該作者

這個CGI程序是怎么回事?

誰告你它是在 windows 下運行的?

論壇徽章:
0
3 [報告]
發(fā)表于 2005-06-06 20:03 |只看該作者

這個CGI程序是怎么回事?

不是在windows下運行的??
能仔細說說嗎?我是個小菜鳥.

論壇徽章:
0
4 [報告]
發(fā)表于 2005-06-07 01:07 |只看該作者

這個CGI程序是怎么回事?

#!/usr/bin/perl

論壇徽章:
0
5 [報告]
發(fā)表于 2005-06-07 22:15 |只看該作者

這個CGI程序是怎么回事?

光從那個BANG行也不能說明就得在*INUX下用呀,我以前的那些在windows下也可用的.
     求高手幫幫忙啊.

論壇徽章:
0
6 [報告]
發(fā)表于 2005-06-08 08:00 |只看該作者

這個CGI程序是怎么回事?

設為"D:\tmp"試試,并確保其存在。

論壇徽章:
0
7 [報告]
發(fā)表于 2005-06-08 12:58 |只看該作者

這個CGI程序是怎么回事?

我這樣也試了,可是還不行?
怎么總是說,沒有MIME頭呢?可是我確實是寫了呀?
誰能告訴我這是為什么?
謝謝
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP