<html>
<head>
<title>Registration Sent</title>
</head>
<body>
<?php
if(!empty($_POST)){
$to = "training@dysailing.com";
$subject = "DYS Training Event Registraion";
$email = $_REQUEST['email'] ;
$message = "Competitor Info: <br>Helm Name:" & $_REQUEST['helmname'] & "<br>Email:" & $_REQUEST['email'] & "<br>Club:" & $_REQUEST['club'] & "<br>Boat Class:" & $_REQUEST['class'] & "<br>Sail Number:" & $_REQUEST['sailno'] & "<br>Event: " & $_REQUEST['event'] & "<br><br>Parents Info:<br>Name:" & $_REQUEST['name'] & "<br>Can Help With:" & $_REQUEST['help'] & "<br>Contact Number:" & $_REQUEST['telno'] & " <br>Email Address: " & $_REQUEST['helperemail'];
$headers = "From: $email";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Registration Received"; }
else
{print "There has been an issue with your registration, please try again. If the problem persists, please inform us through the contact webmaster link on the home page."; }
print "<form method=\"LINK\" action=\"index.htm\"><input type=\"submit\" value=\"Return to home page\"></form>";
}
?>
</body>
</html>
In case it is relevant, here is the form code (the labels got cut off when I removed the messy layout stuff, lines of #'s are to cover info):
<form method="post" action="train.php">
<input name="helmname" type="text" size="20" />
<input name="email" type="text" size="20" />
<input name="club" type="text" size="20" />
<input name="class" type="text" size="10" />
<input name="sailno" type="text" size="10" />
<select name="event">
<option value="####################">12th December Race Training at Burton</option>
<option value="####################">13th March Team Race Training at Burton</option>
</select>
<select name="help" size="5" multiple>
<option value="registration">Registration</option>
<option value="safety">Safety</option>
<option value="photography">Photography</option>
<option value="race management">Training</option>
<option value="event presentation">Other</option>
</select>
<input name="name" type="text" size="20" />
<input name="telno" type="text" size="20" />
<input name="helperemail" type="text" size="20" />
<input type="submit"><input name="Reset" type="reset" value="Reset" />
</form>
and here is the email that is received:
Subject: Training Event Registration Received
Message Body: We have received your event registration. Thank you for registering, see you at the event.