レッツPHP!




サンプル


<?php

/* Password */
define("PASS", "1234");
/* This Script */
define("SELF", "test.php");

echo '<html><body>';

if (!isset($_POST['pass'])) {
echo '<P><center><form action="'.SELF.'" method=POST><br><br>
<b>Pass : </b><input type=password name=pass size=8>
<input type=submit value="Login"></form></center>';
}
else {
if($_POST['pass'] != PASS) die("Incorrect Password");

echo 'ok';

}
echo '</body></html>';
?>