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

 一个程序自动刷新页面的例子

作者来源: 
阅读 1289 人次 , 2006-3-29 4:02:00 


#!/usr/bin/perl

use http::request;
use lwp::useragent;
my $ua = new lwp::useragent;
$|=1;
print "content-type:text/html\n\n";
$ua->agent("agentname/1.0 " . $ua->agent);
$ua->timeout(80);
# create a request
my $req = new http::request post => 'http://search.sina.com.cn/cgi-bin/search/search.cgi';
$req->content_type('application/x-www-form-urlencoded');
my $buffer="ss=sina&_searchkey=%bb%ee%b6%af%2b%bd%b1%cf%ee&_andor=and&s1=%cb%d1%cb%f7";
$req->content($buffer);
# pass request to the user agent and get a response back
my $res = $ua->request($req);
# check the outcome of the response
if ($res->is_success) {
print length($res->content);
print <<end;
<meta http-equiv="refresh" content=1;host="http://***.***.***.***/nperl/autorefresh.pl">

end
;
print $res->content ;

} else {

print "bad luck";
}

 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:尝试用sql查询语句操纵普通文本数据库
· 下一篇:CGI安全漏洞资料速查
· 跟我学Perl(3)
· WEB服务CGI接口漏洞分析
· 用Perl语言进行Socket编程之二
· Perl程序设计中常用的函数之二
· perl如何内嵌html


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