first of all i would keep the password in a seperate file
?>
$password = "whateverpassswordyouwant";
?>
then this hopefully should work
<?
//include the password to be matched
include 'password.
php';
//this is the password that the user enters
$pass = $_POST['password'];
//checks to see if password has been entered before pressing submit
//if not disoplay the form
if (!isset($_POST['password'])) {
?>
<form method="post" action="check_pass.
php">
<table border="1" cellpadding="0" cellspacing="0" align="left">
<tr>
<td id='ps'><b>Password: </b></td>
<td><input type="password" name="password" size="12"></td>
</tr>
<tr>
<td align="center"><input type="submit" value="Login"></td>
</tr>
</table>
</form>
<?
}
//checks for empty field and returns error message
elseif (empty($pass)) {
echo "password required";
}
else {
//compare the 2 passwords
if (strcmp( $password,$pass ) !=0){
echo "wrong password";
//stop the script from continuing
exit;
}
//do whatever you want here after successful password
?>