<?php
if (isset($_POST['form'])) {
$surname = $_POST['surname'];
$first_name = $_POST['first_name'];
$initial = $_POST['initial'];
$address = $_POST['address'];
$contact_number1 = $_POST['contact_number1'];
$contact_number2 = $_POST['contact_number2'];
$contact_number3 = $_POST['contact_number3'];
$emailaddress = $_POST['email_address'];
$product_number1 = $_POST['product_number1'];
$product_number2 = $_POST['product_number2'];
$product_number3 = $_POST['product_number3'];
$product_number4 = $_POST['product_number4'];
$comments = $_POST['comments'];
$layout = "Mr. ".$first_name." ".$initial." ".$surname." who lives at ".$address." which can be reached on ".$contact_number1." who's e-mail address is ".$emailaddress." has the product number ".$product_number1." and says ".$comments."
$to = '[email protected]';
$subject = 'New User';
$message = $layout
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
}
else {
echo "<form name=\"form\" action=\"#\" method=\"post\">
<b>Family Name</b> <input type=\"text\" name=\"surname\" value=\"\"><br>
<b>First Name</b> <input type=\"text\" name=\"first_name\" value=\"\"><br>
<b>Middle Name Initial</b> <input type=\"text\" name=\"initial\" value=\"\"><br>
<b>Home Address</b> <input type=\"text\" name=\"address\" value=\"\"><br>
<b>Contact Number</b> <input type=\"text\" name=\"contact_number1\" value=\"\"><br>
<b>Contact Number</b> <input type=\"text\" name=\"contact_number2\" value=\"\"><br>
<b>Contact Number</b> <input type=\"text\" name=\"contact_number3\" value=\"\"><br>
<b>Email Address</b> <input type=\"text\" name=\"email_address\" value=\"\"><br>
<b>Product Number</b> <input type=\"text\" name=\"product_number1\" value=\"\"><br>
<b>Product Number</b> <input type=\"text\" name=\"product_number2\" value=\"\"><br>
<b>Product Number</b> <input type=\"text\" name=\"product_number3\" value=\"\"><br>
<b>Product Number</b> <input type=\"text\" name=\"product_number4\" value=\"\"><br>
<b>Comments</b> <textarea></textarea><br>
<input type=\"submit\" value=\"Submit\"><input type=\"reset\" value=\"Restart\">";
}
?>