<? $password = "whatever"; if ($password == "$password"){ header("Location: http://mysite.com/secret.php"); } else{ echo "sorry wrong pasword, please try again"; } ?>