Ok, I am making a html form with a php mailer. This is my html code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Pageant Application Request</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #CCCCCC;
}
body {
background-color: #000000;
}
-->
</style>
</head>
<body>
<form method="POST" class="style2" action="mailer.php">
For an application please fillout and submit. <br>
Name <br>
<input type="text" name="textfield">
<br>
Address 1 <br>
<input type="text" name="textfield">
<br>
Address 2 <br>
<input type="text" name="textfield">
<br>
City <br>
<input type="text" name="textfield">
<br>
State <br>
<input type="text" name="textfield">
<br>
Zip Code <br>
<input type="text" name="textfield">
<br>
Country <br>
<input type="text" name="textfield">
<br>
Phone Number <br>
<input type="text" name="textfield">
<br>
Email Address <br>
<input type="text" name="textfield">
<br>
Questions <br>
<textarea name="Comments" cols="50" rows="10"> </textarea>
<br>
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>
This is my php code:
<?php
if(isset($_POST['submit'])) {
$to = "woodbrosproductions@yahoo.com";
$subject = "Application Request";
$name_field = $_POST['name'];
$address_1_field = $_POST['address 1'];
$address_2_field = $_POST['address 2'];
$city_field = $_POST['city'];
$state_field = $_POST['state'];
$zip_code_field = $_POST['zip code'];
$country_field = $_POST['country'];
$phone_number_field = $_POST['phone number'];
$email_address_field = $_POST['email address'];
$questions = $_POST['questions'];
$body = "From: $name_field
Address 1: $address_1_field
Address 2: $address_2_field
City: $city_field
State: $state_field
Zip Code: $zip_code_field
Country: $country_field
Phone Number: $phone_number_field
Email Address: $email_address_field
Questions: $questions
";
echo "Data has been submitted to Peterson Prouctions!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
The form works, but when I get the email, it only has the headings of the form, ie. name, address, …etc. It doesn’t send the information that the user input.
Any help would be greatly appreciated.
Thanks.