Hallo,
Het volgende wilt niet werken.
HEt zal wel rap duidelijk zin wat de bedoeling is ....
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<?
function confirm_form($first_name, $last_name, $mail, $zip_code, $os){
print("Thanks\n");
print("Contact Info\n");
print("$first_name, $last_name \n");
print("$mail \n");
print("zip: $zip\n");
print("os: $os \n");
}
function print_form($first_name, $last_name, $mail, $zip_code, $os){?>
<table width="34%" border="2" cellspacing="0" cellpadding="0">
<form method="post">
<tr>
<td width="38%">First Name</td>
<td width="62%"><input name="first_name" type="text" value="<? print ("$first_name") ?>"></td>
</tr>
<tr>
<td>Last name*</td>
<td><input name="last_name" type="text" value="<? print $last_name ?>"></td>
</tr>
<tr>
<td>e-mail address*</td>
<td><input name="mail" type="text" value="<? print $mail ?>"></td>
</tr>
<tr>
<td>Zip-code*</td>
<td><input name="zip_code" type="text" value="<? print $zip_code ?>"></td>
</tr>
<tr>
<td>operating system</td>
<td><input name="os" type="text" value="<? print $os ?>"></td>
</tr>
</table>
<input type="submit" value="submit!">
<input type="reset" vamue="reset">
<? }
function check_form($last_name, $mail, $zip_code){
if(!$last_name && !$mail&& !$zip_code){ //waarom niet !isset($_POST["mail"]
confirm_form($first_name, $last_name, $mail, $zip_code, $os);
}
elseif(!isset($_POST["last_name"])){
print("You are missing some required fields \n");
print("you need to fill your Last name\n");
}
elseif(!isset($_POST["mail"])){
print("You are missing some required fields \n");
print("you need to fill your e-mail\n");
}
elseif(!isset($_POST["zip_code"])){
print("You are missing some required fields \n");
print("you need to fill your zip code\n");
}
print_form($last_name, $mail, $zip_code);
if(empty($_POST)){
?>Please enter your information <br>
met * verplicht in te vullen \n")<br>
<? print_form("","","","","");
} ?>
</body>
</html>
757 views