Hi there,
I am trying to password protect my website.
I have the following code, which works, but the error message comes up saying:
Unidentified index - password.
Meaning the first line that 'password' appears on.
What do I need to do to get rid of this error message?
?php
if($_POST['password']) {
if($_POST['password'] == 'MYPASSWORD') {
?>
Put your page's contents here.
<?php
} else {
?>
Incorrect password - please try again.
<?php
}
} else {
?>
<form method='post' action='login.php'>
<p>
<input type="text" name="password" size=25 maxlength=25>
Password</p>
<p>
<input type="Submit" name="Submit" value="Search">
<input type="reset" name="Clear" value="Clear">
</p>
</form>
<?php
}
?>