用Perl制作留言本实例之四

最后:
$filename="c:/website/htdocs/book.html";

open(FILE,">> $filename");
print FILE "名字:$FORM{'name'}n";
print FILE "Email:
print FILE "留言:$FORM{'suggest'}";
close{FILE};

print "谢谢留言";
print"请观看留言本";

exit(0);
输出内容到文件和屏幕上。完成留言的程序。

book.html:
这个程序中book.html没有什么特别的要求,可以不用写,就让
程序自动生成。
现在有的cgi程序,对book.html也有设定,比如在>之间就写上注释

这样,在程序对留言数据操作的时候,就可以忽略掉文件内的其它内容。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus