动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   Cgi/Perl → 阅读文章

 一 个 CGI 探 针 代 码的编写

作者来源: 
阅读 1922 人次 , 2006-4-19 18:10:00 


  #!/usr/bin/perl #open STDOUT, ">", "/tmp/env.txt"; print qq{Content-type: text/html\n\n<html><head><title>CGI Environment</title></head><body>\n}; print qq \$ENV{$_} => `$ENV{$_}'
\n  for sort keys %ENV; print qq{STDIN: `}; print <STDIN> print qq{'}; print qq{<p><a href="env.cgi?some%20stuff">Circular link</a>
}; print qq{<form method=post><input type=text name=text><input type=submit name=submit value=POST></form>}; print qq{<form method=get><input type=text name=text><textarea name="textarea"></textarea><input type=submit name=submit value=GET></form>}; print qq{<form method=post>Input type=image: <input type=imae name=imagename src="/image.cgi"></form>}; open FILE, $0; local $/; my $source = <FILE> close FILE; $source =~ s/&/&/g; $source =~ s/</</g; $source =~ s>/>/g; print "Code for this page: <pre>\n$source\n</pre>"; print "</body></html>";   
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:Perl CGI 编程中的安全点滴
· 下一篇:CGI 安全问题详解与说明(二)
· perl实例分析教程之六
· Cgi入门教程之:11 写文件
· Perl程序设计中常用的函数之三
· CGI教程(1)
· Perl语言的文字处理模式之二


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077