Quick Form Method:
Collects information and prints it, using the form "name" as the field name for the printout.
Obviously you can add dropdowns or radio buttons as required
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Your Form</title>
</head>
<body>
<? if($_POST['submit']){
echo" You Entered the Following: ";
while (list($a, $value) = each ($_POST)){
if($a!="submit"){
$a=str_pad($a,20,".");// pads the length of the name
$value=strip_tags($value);
$a=str_replace("_", " ", $a);//removes underscored from variable names
$a=ucwords($a); // capitalizes the names
echo "<pre>$a $value</pre>";
$e_var.="$a $value\n\r"; //This packs the same information into a variable that can be emailed (with additonal code)
}
}
echo"</body></html>";
die;
}
echo "<h3>Form Name</h3> <form method=\"post\" name=\"FormBox1\" action=".$_SERVER["PHP_SELF"]." enctype=\"multipart/form-data\" target=\"_self\" >";
?>
<p>Fill out the form below<br></p>
<label for="cf_name"><B>First Name</B></label>
<br><input type="text" name="First_Name" id="cf_name" size="30" maxlength="50" ><br>
<label for="cl_name"><B>Last Name</B></label>
<br><input type="text" name="Last_Name" id="cl_name" size="30" maxlength="50" ><br>
<label for="cemail"><B>Email Address</B></label>
<br><input type="text" name="email" id="cemail" size="60" maxlength="90" ><br>
<label for="ccomment"><B>Your Message</B></label>
<br>
<textarea cols="40" rows="10" name="comment" id="ccomment"></textarea><br><br>
<input type="submit" name="submit" id="submit" value="Print Your Results">
</form>
</body>
</html>