Ook al vul ik geen waardes is, toch wordt de foutmedling niet actief, en worden er lege gegevens in de db toegevoegd.
<?php
include ('config.php');
include ('header.php');
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="49"><img src="images/lmc.gif" width="49" height="36"></td>
<td valign="top" background="images/mcbg.gif" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="9"></td>
</tr>
<tr>
<td><div align="center" class="menuhead"> Aanmelden</div></td>
</tr>
</table></td>
<td width="49"><img src="images/rmc.gif" width="49" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" bgcolor="#5C5E4F" class="sideborders">
<table width="100%" border="0" cellspacing="0" cellpadding="3" height="190">
<tr>
<td height="184" valign="top" align="center">
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$voornaam= htmlspecialchars($_POST['voornaam']);
$naam= htmlspecialchars($_POST['naam']);
$email= htmlspecialchars($_POST['email']);
$gebdat= htmlspecialchars($_POST['gebdat']);
$land= htmlspecialchars($_POST['land']);
$username= htmlspecialchars($_POST['username']);
$userid= htmlspecialchars($_POST['userid']);
$error = NULL;
if (!isset($voornaam)) {
$error .= " Gelieve een correcte voornaam in te vullen.<br><br> ";
}
if (!isset($naam)) {
$error .= " Gelieve een correcte achteraam in te vullen.<br><br> ";
}
if (!isset($email)) {
$error .= " Gelieve een correct emailadres in te vullen.<br><br> ";
}
if (!isset($gebdat)) {
$error .= " Gelieve een correcte geboortedatum in te vullen.<br><br> ";
}
if (!isset($land)) {
$error .= " Gelieve een correct land te selecteren.<br><br> ";
}
if (!isset($username)) {
$error .= " Gelieve een correcte username in te vullen.<br><br> ";
}
if (!isset($userid)) {
$error .= " Gelieve een correct userid in te vullen.<br><br> ";
}
if (!empty($error)) {
echo $error ;
}
else {
$sql = "INSERT INTO aanmelding (naam, voornaam, email, gebdat, land, username, userid) VALUES ('".$naam."', '".$voornaam."', '".$email."', '".$gebdat."', '".$land."', '".$username."', '".$userid."')";
$query = mysql_query($sql);
echo "Beste $voornaam $naam <br> U bent succesvol aangemeld. <br> Wij zullen uw aanvraag zo snel spoedig mogelijk verwerken. <br> Het *=LP=* team! ";
}
}
else {
?>
<table border="0" align="center" class="hyperlinks">
<tr>
<td align="center">
</td>
</tr>
</table>
<form method="POST" name="submit" action="aanmelden.php">
<table cellspacing="0" cellpadding="4" align="center" width="90%" class="hyperlinks">
<tr>
<td colspan="2" bgcolor="#4F5143" align="left" style='border: solid 1px #383A2E; border-right: solid 1px #383A2E'><b>Persoonlijke Gegevens:</b></td>
</tr>
<tr>
<td align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>Voornaam:</b></td>
<td align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="text" name="voornaam"></td>
</tr>
<tr>
<td align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>Achternaam:</b></td>
<td align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="text" name="naam"></td>
</tr>
<tr>
<td align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>Email:</b></td>
<td align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="text" name="email"></td>
</tr>
<tr>
<td align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>Geboortedatum:</b></td>
<td align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="text" name="gebdat"></td>
</tr>
<tr>
<td valign="top" align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>Land:</b></td>
<td valign="top" align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="radio" name="land" value="Belgiƫ"> Belgiƫ<br><input type="radio" name="land" value="Nederland"> Nederland<br></td>
</tr>
<tr>
<td colspan="2" bgcolor="#4F5143" align="left" style=' border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>America's Army Gegevens:</b></td>
</tr>
<tr>
<td align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>AA Usernaam:</b></td>
<td align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="text" name="username"></td>
</tr>
<tr>
<td align="left" width="20%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><b>AA Userid:</b></td>
<td align="left" width="80%" style='border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E; border-left: 0px'><input type="text" name="userid"> <font color="red" size="1"> Nr achter uw trackerprofiel link. Bv: http://aaotracker.com/usertracker.php?userid=<u>53159</u></td>
</tr>
<tr>
<td colspan="2" bgcolor="#4F5143" align="center" style=' border: solid 1px #383A2E; border-top: 0px; border-right: solid 1px #383A2E'><input type="submit" name="submit" value="Aanmelden"></td>
</tr>
</table>
</form>
<?php } ?>
</td>
</tr>
</table>
</td>
<tr>
<td background="images/crbg.gif" height="36" class="sideborders"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
<tr>
<td><div align="center" class="menuhead"> Copyright 2006 @ Lost Platoon </div></td>
</tr>
</table>
<?php
include ('footer.php');
?>
Iemand een idee?
Groetjes