The password doesn't appear anywhere in the following script except for the hashed version. Password is apple.
<form name="form" method="post" action="">
<p>
<input type="text" name="str">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<?php
if(isset($str)) {
if (sha1($str) === 'd0be2dc421be4fcd0172e5afceea3970e2f3d940') {
echo "Correct Password";
}
else{ echo "Incorrect Password";}}
?>
Use sessions or cookies to stay logged in.