标题:
比较两种CGI编程风格
[打印本页]
作者:
cnangel
时间:
2003-8-6 17:15
标题:
比较两种CGI编程风格
#!/usr/bin/perl
use CGI;
#$name= adasas;
$addr= remote_host;
$q= new CGI;
print$q->header(-type=>'text/html',
-charset=>'gb_2132'
);
print$q->start_html(-title=>'test',
-bgcolor=>'#FFffFF',
-author=>'cnangel',
-text=>'#000000');
$q->p('This is what I mean by '),
$q->b('abstracted'),
print$q->end_html();
exit;
复制代码
#!/usr/bin/perl
print "content-type:text/html \n\n";
if(1 eq 1){&eee;exit;}else{print "error";exit;}
sub eee{
print<<EOF
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>leoboard</title>
<meta http-equiv="refresh" content="1; url=http://www.leoboard.com/cgi-bin/leoboard.cgi">
</head>
<body>
</body>
</html>
EOF
}
复制代码
欢迎光临 星星博客 (http://commerce.huhoo.net/)
Powered by Discuz! 7.0.0