password with init.test
index.html
<html>
<head>
<title>password Bord</title>
</head>
<body>
<center>
<h1><b>password Bord</b></h1>
<hr>
<form action=”passowrd.cgi” method=”POST”>
パスワード<br>
<input type=”password” name=”password”><br>
<input type=”submit” value=”送信”>
<input type=”reset” value=”リセット”>
</form>
</center>
</body>
</html>
init .text(password is 001)and save
passowrd.cgi
#!/usr/bin/perl
BEGIN{ $| = 1; print “Content-type: text/html\n\n”; open(STDERR, “>&STDOUT”); }
use CGI;
$query = new CGI;
$password = $query->param(‘password’);
#data フォルダーのテキストデータ読み込み###################
open(IN, “<init.txt”);
@data=<IN>;
close (IN);
##########################################################
print <<END;
<html>
<head>
<title>password</title>
</head>
<body bgcolor=”#FFFFFF” text=”#000000″>
<div align=”center”>
<h1><b>password</b></h1>
</div>
<hr>
END
#配列@data の中身を##################################
for($i=0;$i<@data;$i++){
@retudata=split(/\t/,$data[$i]);
if($data[$i]=~m/$password/){
print”OK\n”;
}else{
print”パスワードまちがってるよ~\n”;
}
}
print”</body>\n”;
print”</html>\n”;

