What version of PHP are you running? Are global variables on?
You might want to change $PHP_SELF to $_SERVER['PHP_SELF']
and for this line,
<form method="post" action="?action=login"><input type="hidden" name="PHPSESSID" value="502cf8939a3388aa22e9c4cfa1d42ea1" />
Change it to:
<form method="post" action="<?= _$SERVER['PHP_SELF'] ?>">
<input type="hidden" name="action" value="login">
<input type="hidden" name="PHPSESSID" value="502cf8939a3388aa22e9c4cfa1d42ea1" />
This is because Netscape doesn't accept actions with variables in them. =\