PHP ver gevorderde |
|
Vorige probleem fixed, was idd iets doms wat ik nu pas zie na
10 min zoeken :x ( ; ) vergeten.. *zucht*
Deze bolean werkt niet, hoe moet ik dit fixen?
Parse error: parse error, unexpected T_BOOLEAN_OR in C:\Program Files\YellowTip\Htdocs\website_net\register.php on line 252
if (empty($_POST['user_bd1'])) || (empty($_POST['user_bd2'])) || (empty($_POST['user_bd3']))
$register_error[] = "Empty Date of Birth";
elseif (!valid_birthdate($user_bd1 && $user_bd2 && $user_bd3))
$register_error[] = "Invalid Date of Birth";
else
$user_birthdate = "$user_bd1-$user_bd2-$user_bd3";
if (empty($_POST['user_bd1'])) || (empty($_POST['user_bd2'])) || (empty($_POST['user_bd3'])) $register_error[] = "Empty Date of Birth"; elseif (!valid_birthdate($user_bd1 && $user_bd2 && $user_bd3)) $register_error[] = "Invalid Date of Birth"; else $user_birthdate = "$user_bd1-$user_bd2-$user_bd3";
Het stukje uit de formulier..
echo '<tr>';
echo '<td> Date of Birth:*</td>
<td>
DD <input name="user_bd1" type="text" size="3" maxlength="2" value="' . $user_bd1 . '">
MM <input name="user_bd2" type="text" size="3" maxlength="2" value="' . $user_bd2 . '">
YYYY <input name="user_bd3" type="text" size="5" maxlength="4" value="' . $user_bd3 . '">
</td>';
echo '</tr>';
echo '<td> Date of Birth:*</td> <td> DD <input name="user_bd1" type="text" size="3" maxlength="2" value="' . $user_bd1 . '"> MM <input name="user_bd2" type="text" size="3" maxlength="2" value="' . $user_bd2 . '"> YYYY <input name="user_bd3" type="text" size="5" maxlength="4" value="' . $user_bd3 . '"> </td>';
Hier de fucntion_birthdate stukkie
function valid_birthdate ($user_bd1, $user_bd2, $user_bd3)
{
return (ereg ('(^0-9{2,2$)', $user_bd1, $user_bd2, $user_bd3));
}
function valid_birthdate ($user_bd1, $user_bd2, $user_bd3) { return (ereg ('(^0-9{2,2$)', $user_bd1, $user_bd2, $user_bd3)); }
Thnx in advance,
Edwin ter Horst (Nrzonline)
|