show.pl
#!/usr/bin/perl
print "content-type: text/html\n\n";
print "<html>\n";
print "<head><meta http-equiv=content-type content=text/html;charset=gb2312>\n";
print "<head>\n<body bgcolor=#c0c0c0>\n";
print "<p> </p>";
print "<p align=center><font color=#8080ff><big><strong>送您一百个随机密码, 虽然不好记, 但是都是随机产生的, 很安全!</strong></big></font></p>\n";
print "<div align=center><center>";
print "<table border=1 bgcolor=#c0c0c0 cellspacing=1 cellpadding=3>\n";
for($i=0;$i<10;$i++)
{
print "<tr>";
for($j=0;$j<10;$j++)
{
print "<td>";
print &getstring;
print "</td>";
}
print "</tr>\n";
}
print "</table></center></div>\n";
print "<p></p>";
print "<p><center><a href=show.pl><span style=\"font-family: 宋体; font-size: 10pt\">再算一遍</span></a></center></p>";
print "\n</body></html>\n";
exit;
sub getstring
{
$str="";
for($k=0;$k<8;$k++)
{
$num=int(rand(3));
if($num==0) { $str.=pack("c",rand(10)+48); }
elsif($num==1) { $str.=pack("c",rand(26)+65); }
elsif($num==2) { $str.=pack("c",rand(26)+97); }
}
return $str;
}