Hey everyone,
Forgive me if this is a dumb question but I can't figure out why my data that I've typed in or selected in the form doesn't show when I actually send out an email once I click the submit button. I get an email stating the subject of the email that I sent but the content isn't there..why is this?
<?php
error_reporting (E_ALL ^ E_NOTICE);
$to = "gene.howell9@gmail.com";
$subject = "Submitions from College/University Admission Services Form";
$Sname = $_POST["Sname"];
$Fname = $_POST["Fname"];
$Mname = $_POST["Mname"];
$Lname = $_POST["Lname"];
$email = $_POST["email"];
$history = $_POST["history"];
$age = $_POST["age"];
$sex = $_POST["sex"];
$country = $_POST["country"];
$SchoolsAttended = $_POST["SchoolsAttended"];
$CriminalRecord = $_POST["CriminalRecord"];
$record = $_POST["record"];
$status = $_POST["status"];
if($_POST['submit']){
if($Sname == '' || $Fname == '' || $Mname == '' || $Lname == '' || $email == '' || $history == '' || $age == '' || $sex == '' || $country == '' || $SchoolsAttended == '' || $CriminalRecord == '' || $status == ''){
$feedback = "<b>Fill out all the fields please before submitting</b>";
}else{
mail($to, $subject, $body, $header);
$feedback ="<b>Thanks for your submition! Your form has been sent!</b>";
}
}
$body = <<<EMAIL
Form submitted from $Fname $Lname.
Surname field: $Sname
First name field: $Fname
Middle name field: $Mname
Last name field: $Lname
History field: $history
Age: $age
Sex: $sex
Country: $country
Schools Attended: $SchoolsAttended
Criminal Record: $CriminalRecord
If yes was selected, list of details: $record
Marital Status: $status
From, $Fname
EMAIL;
$header = "From: $email";
?>
Here is the form as well:
<form style="padding: 10px;" method="post" action="?">
Surname: <input type="text" maxlength="12" name="Sname"><br /><br />
First Name: <input type="text" maxlength="12" name="Fname"><br /><br />
Middle Name: <input type="text" maxlength="12" name="Mname"><br /><br />
Last Name: <input type="text" maxlength="36" name="Lname"><br /><br />
Email: <input type="text" maxlength="36" name="email"><br /><br />
History: <input type="text" maxlength="50" name="history"><br /><br />
Age: <input type="text" size="1" maxlength="2" name="age"><br /><br />
Sex: <input type="radio" value="Male" name="sex">Male<input type="radio" value="Female" name="sex">Female<br /><br />
Country of Origin: <select name="country">
<option value="Select">-Select a Country-</option>
<option value="United States">United States</option>
<option value="Africa">Africa</option>
<option value="Canada">Canada</option>
</select><br /><br />
Schools Attended: <input type="text" name="SchoolsAttended"><br /><br />
Do you have a criminal record? <input type="radio" value="yes" name="CriminalRecord">Yes <input type="radio" value="no" name="CriminalRecord">No<br /><br />
If yes was selected, please list them in the field provided: <input type="text" name="record"><br /><br />
Marital Status: <select name="status">
<option value="select">-Select your status-</option>
<option value="single">Single</option>
<option value="married">Married</option>
<option value="divorced">Divorced</option>
<option value="widowed">Widowed</option>
</select><br /><br />
<input class="button" type="submit" value="submit" name="submit"> <input class="button" type="reset" value="Reset" name="reset" />
</form>
Thanks in advance!
-Geneh23