The following PHP code echoes error before entering mistaken password and gives - Notice: Undefined index: password
<?php
//Specify password here
$pass='pass';
if($_POST['password']!=$pass)
{
echo ("<div class='errmg'>Error</div>");
}
else
{
header( 'Location: admin.php' ) ;
}
?>
Below I've the following HTML
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
Enter password:
<input name="password" type="password">
<input name="send" type="submit" value="Log in!">
</form>
Please help me to repair these errors and make this login-redirect better