20241004 perl
You are currently viewing a revision titled "20241004 perl", saved on 2024年10月4日 9:43 PM by Sonam tamang | |
---|---|
タイトル | 20241004 perl |
コンテンツ | #!/usr/bin/perl
BEGIN{ $| = 1; print "Content-type: text/html\n\n"; open(STDERR, ">&STDOUT"); }
use CGI;
$query = new CGI;
open(IN, "< save.txt");
@data=<IN>;
close (IN);
print <<END;
<html>
<head>
<title>db</title>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<h1><b>データベース初歩</b></h1>
</div>
<hr>
<table border="1" width="100%">
<tr>
<td>年</td><td>月</td><td>日</td><td>時</td><td>分</td><td>名前</td><td>住
所
</td><td>電話番号</td><td>アドレス</td>
</tr>
END
for($i=0;$i<@data;$i++){
@retudata=split(/\t/,$data[$i]);
for($j=0;$j<=$retudata;$j++)
{
print"<tr><td>@retudata[0]</td><td>@retudata[1]</td><td>@retudata[2]</td><td>@retudata[3]</td><td>@retudata[4]";
print"</td><td>@retudata[5]</td><td>@retudata[6]</td><td>@retudata[7]</td><td>@retudata[8]</td></tr>\n";
}
};
print"</table></body></html>"; |
抜粋 | |
脚注 |