Hi, I have been trying to make a more difficult email that I still cannot get to work correctly I am now trying to make a more simple form but I still am not doing something right. Will someone please point out to me what I am doing wrong? or what needs to be chanegd?? Below is my html and php. PROBLEM: when you hit submit nothing happens it just clears my form completetly and does not email anything.
Thank you!!!
rubberduckie
<form method="POST" action="mailer.php">
<label>First Name:
<input type="text" name="first" id="first" />
</label>
<p><label>Last Name:
<input type="text" name="last" id="last" />
</label>
</p>
<p>Class:
<label>
<input type="radio" name="radio" id="2007" value="2007" />
2007</label>
<label>
<input type="radio" name="radio" id="2008" value="2008" />
2008</label>
<label>
<input type="radio" name="radio" id="2009" value="2009" />
2009</label>
</p>
<p>
<label>Preferred E-mail:
<input type="text" name="email" id="email" />
</label>
</p>
<p>Mailing
<label>Address:
<input type="text" name="address" id="address" />
</label>
<label><br />
<br />
City:
<input type="text" name="city" id="city" />
</label>
<label> State:
<input type="text" name="state" id="state" />
</label>
<label>Zip:
<input type="text" name="zip" id="zip" />
</label>
</p>
<p>
<label>Current Residency or Internship Program & Speciality:
<input type="text" name="residency" id="residency" />
</label>
</p>
<p>
<label>Comments:
<input name="comments" type="text" id="comments" value="" size="45" />
</label>
</p>
<p>
<label>Any News; new residency, publications, awards, honors, weddings, engagements, births
<textarea name="news" id="news" cols="45" rows="5"></textarea>
</label>
<label></label>
</p>
<p>
<label>
<input type="submit" name="submit" id="submit" value="Submit" />
</label>
<label>
<input type="reset" name="reset" id="reset" value="Reset" />
</label>
</p>
</form>
<?php
if(isset($_POST['submit'])) {
$to = "XXXX@myemail.com";
$subject = "Alumni Update";
$firstname_field = $_POST['first'];
$lastname_field = $_POST['last'];
$option = $_POST['radio'];
$email_field = $_POST['email'];
$address_field = $_POST['address'];
$city_field = $_POST['city'];
$state_field = $_POST['state'];
$zip_field = $_POST['zip'];
$residency_field = $_POST['residency'];
$comments = $_POST['comments'];
$news = $_POST['news']
$body = "From: $firstname_field
$lastname_field
Option: $option
E-Mail: $email_field
$check_msg Address: $address_field
City: $city_field
state: $state_field
Zip: $zip_field
Residency:
$residency_field
Comments:
$comments
News:
$news
" ;
echo "Thank you! Your information has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>