form data not being received via email
Posted: Wed Nov 25, 2015 10:00 am
hi,
when i submit my form the only data i am receiving in email is the email of the sender, no other data is coming threw!
what's going on?
thank-you
here is the code
when i submit my form the only data i am receiving in email is the email of the sender, no other data is coming threw!
what's going on?
thank-you
here is the code
Code: Select all
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];
$from = 'From:gavini2@adhdclinic.com';
$to = 'ceelippens2@gmail.com';
$subject = 'adult new patient form';
$body = "firstName: $firstname \n\nlastName: $lastname \n\nEmail: $email \n\nAge: $age \n\nStreet: $street \n\nCity: $city \n\nState: $state\n\nZipcode: $zipcode\n\n cellphone: $cellphone\n\n homephone: $homephone \n\n Employername: $employername \n\n Workstreet: $workstreet\n\n\ Workcity: $workcity\n\n Workstate: $workstate \n\n Workzipcode: $workzipcode \n\n Workphone: $workusrtel \n\n MartialStatus: $martialStatus \n\n contactname: $contactname \n\n";
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
echo '<p>Your message has been sent!</p>';
} else {
echo '<p>Something went wrong, go back and try again!</p>';
}
}
?>
<form method="post" name="commentform" action="adlutf.php" autocomplete="on">
<h2 class="text-center"><strong>New Adult ADHD Patient /<br>Family And Insurance Information Form</strong></h2><hr>
<p class="name">
<div class="fieldBlock">
<label for="name">First Name</label>
<input type="fi" name="firstname" id="firstname" placeholder="John " />
</div>
<div class="fieldBlock">
<label for="name">Last Name</label>
<input type="text" name="Lastname" id="lastname" placeholder=" Doe" />
</div>
</p>
<p class="date">
<div class="fieldBlock">
<label for="Date">Date of Birth</label>
<input type="text" name="dob" id="dob" placeholder="12/09/1977" />
</div>
<div class="fieldBlock">
<label for="name">Age</label>
<input type="text" name="age" id="age" placeholder="35" />
</div>
</p>
<div style="clear:both;"> </div>
<p class="sex">
<label><input type="checkbox" id="CheckboxMale" name="driving">Male</label>
<label><input type="checkbox" id="CheckboxFemale" name="driving">Female</label>
</p>
<p><strong>*<span style="font-size:14px;color:#C33;">Attenion</span>:</strong> If you do not include a proper home address in the fields below, you're form will be discarded/deleted immediately. Answers such as n/a are not acceptable answers. We need a complete and accurate address to be able to bill you for our services, as well as creating a medical record for you.</p>
<p class="address">
<div class="fieldBlock">
<label for="name">Street</label>
<input type="text" name="street" id="street" placeholder="14 Elm St." />
</div>
<div class="fieldBlock">
<label for="name">City</label>
<input type="text" name="city" id="city" placeholder="Novi" />
</div>
<div class="fieldBlock">
<label for="name">State</label>
<input type="text" name="state" id="state" placeholder="Michigan" />
</div>
<div class="fieldBlock">
<label for="name">Zip Code</label>
<input type="text" name="zipcode" id="zipcode" placeholder="48220" />
</div>
</p>
<div style="clear:both;"> </div>
<p class="email">
<label for="name">Email</label>
<input type="email" name="email" id="email" placeholder="jondoe@gmail.com" />
</p>
<p class="phone">
<div class="fieldBlock">
<label for="name">Cell Phone</label>
<input type="tel" name="usrtel" id="usrtel" placeholder="734-790-7790" />
</div>
<div class="fieldBlock">
<label for="name">Home Phone</label>
<input type="tel" name="usrtel" id="usrtel" placeholder="734-790-7790" />
</div>
</p>
<div style="clear:both;"> </div>
<p class="employername">
<label for="name">Employer Name</label>
<input type="text" name="employername" id="employername" placeholder="Mega Company " />
</p>
<label for="name">Employer Address</label>
<p class="address">
<div class="fieldBlock">
<label for="name">Street</label>
<input type="text" name="workstreet" id="workstreet" placeholder="10005 Main St." />
</div>
<div class="fieldBlock">
<label for="name">City</label>
<input type="text" name="workcity" id="workcity" placeholder="Novi" />
</div>
<div class="fieldBlock">
<label for="name">State</label>
<input type="text" name="workstate" id="workstate" placeholder="Michigan" />
</div>
<div class="fieldBlock">
<label for="name">Zip Code</label>
<input type="text" name="workzipcode" id="workzipcode" placeholder="48220" />
</div>
</p>
<div style="clear:both;"> </div>
</div>
<p class="phone">
<label for="name">Work Phone</label>
<input type="tel" name="usrtel" id="usrtel" placeholder="734-790-7790" />
</p>
<p class="martialstatus">
<label for="name">Martial Status</label>
<select name="Martial Status">
<option value="double chocolate">Single</option>
<option value="vanilla">Married</option>
<option value="strawberry">Divorced</option>
</select>
</p>
<p class="name">
<label for="name">Emergency Contact</label>
<div class="fieldBlock">
<label for="name">First Name</label>
<input type="text" name="name" id="name" placeholder="John " />
</div>
<label><span style="font-size:14px;color:#C33;">Thank-you for filling out and submitting the form.</span></label>
<p class="submit">
<input id="submit" name="submit" type="submit" value="Submit"/>
</p>
</form>