You have alot of confusing code that is not needed. Try the following:
<?
session_start();
session_register('valid');
$display_block = $form_block;
$menu_block = "
<h1>Contact Administration System</h1>
<P><strong>Administration</strong>
<a href='show_addcontact.php'>Add a Contact</a>
<a href='pick_modcontact.php'>Modify a Contact</a>
<a href='pick_delcontact.php'>Delete a Contact</a>
<P><strong>View Records</strong>
<a href='show_contactsbyname.php'>Show Contacts, Ordered by Name</a>";
$form_block = "
<h1>Login</h1>
<FORM method=post action='$PHP_SELF'>
<P><strong>username:</strong><br>
<input type='text' name='username' size=15 maxlength=25></P>
<P><strong>Password:</strong><br>
<input type='password' name='password' size=15 maxlength=25></P>
<input type='hidden' name='op' value='ds'>
<br>
<P><input type='submit'name='submit'value='login'></P>
</FORM>";
if ($op == "ds")
{
if (($username == "admin") && ($password == "abc123")) {
$display_block = $menu_block;
$valid = 'yes';
} else { $msg = "<P><strong>Bad Login - Try Again</strong></P>"; $display_block = $form_block; }
}
?>
<HEAD>
<TITLE>Contact Management System</TITLE>
</HEAD>
<BODY>
<? echo "$display_block";
echo "<P>$msg</P>";
?>
</BODY>