Basically, this would be the corrected version:
<?php
if ($_GET['action'] == "")
{
echo "<form action='login.php' method='POST'> Username: <br><input name='username' size='10'><br>Password:<br><input name='password' type='password' size='10'><br><input type='submit' value='Login'>";
}
elseif ($_GET['action'] == "signup")
{
echo "Create an Account <br />";
echo "<form action='accounts.php?action=create' method='POST'>";
echo "Username: <input name='name'><br />";
echo "Password: <input type='password' name='password1'><br />";
echo "Re-enter Your Password: <input type='password' name='password2'><br />";
echo "Email Address: <input name='email'><br />";
echo "Gender: <input type='radio' name='gender' value='1'>Female <input type='radio' name='gender' value='0'>Male <br /><br />";
echo "<input type='submit' value='Create'>";
}
?>
Moonglobe, yours doesnt make much sense either, in that case.
The potential problem with:
$GET[action] == ""
would be that it has an undefined string constant as the index, and $GET['action'] may not be initialized.
In that case using isset() or empty() would make more sense.
Still, the current method is acceptable, IMO.