I had created the form with save button.When I click on the button no action is performing and I want to save these details in database.Please suggest me and help me to solve this issue.
<div>
<b> Hello <?php echo $_POST["name"]; ?>!</b><br>
<b>Email :</b> <?php echo $_POST["email"]; ?>.<br>
<b>Gender :</b> <?php echo $_POST["gender"]; ?>.<br>
<b>Birthday :</b>
<?php
$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$date = $day."-".$month."-".$year;
$myDate = date("d F Y", strtotime($date));
echo $myDate;
?>
</div>
<form action="sendmail.php" method="post" id="vaccination-form">
<div>
<table border="1" style="width:100%">
<tr>
<th id= "sno" style="font-family: sans-serif; font-size: 100%; font-weight: bold;" class="bg-color" width="5%">S.No</th>
<th id= "vaccine" style="font-family: sans-serif; font-size: 100%; font-weight: bold;" class="bg-color center" width="32%">Vaccine</th>
<th id="decsription" style="font-family: sans-serif; font-size: 100%; font-weight: bold;">Description</th>
<th id="duedate" style="font-family: sans-serif; font-size: 100%; font-weight: bold;" class ="bg-color" width="15%">Due Date</th>
</tr>
<tr>
<td>1</td>
<td><a href="http://www.labwise.in/devel/hepatitis-b/" style="color: rgb(0,255,0)"><font color="#0000FF">Hepatitis B</font></a>
</td>
<td>
<b><span> At birth: </span></b><br></br>
<span>For infants born to hepatitis B surface antigen (HBsAg)-positive mothers, administer HepB vaccine and 0.5 mL of hepatitis B immune globulin (HBIG) within 12 hours of birth. These infants should be tested for HBsAg and antibody to HBsAg (anti-HBs) 1 to 2 months after completion of the HepB series at age 9 through 18 months (preferably at the next well-child visit).</span>
</td>
<td>
<div>
<?php
$date=date_create("now");
$bdate=date_create($myDate);
//echo date_format($dueDate,"d F Y");
if($date >= $bdate)
{
$dueDate=$bdate->modify('+2 month');
echo date_format($dueDate,"d F Y");
}
else
{
$bdate->modify('+1 month');
echo date_format($bdate,"d F Y");
}
?>
</div>
</td>
</tr>
<tr>
<td>2</td>
<td><a href="http://www.labwise.in/devel/rotavirus-2/" style="color: rgb(0,255,0)"><font color="#0000FF">Rotavirus2(RV)</font></a>
</td>
<td>
<b><span>Routine vaccination:</span></b><br></br>
<span>
1.If Rotarix is used, administer a 2-dose series at 2 and 4 months of age.</span><br></br>
<span>2.If RotaTeq is used, administer a 3-dose series at ages 2, 4, and 6 months.</span><br></br>
<span>3.If any dose in the series was RotaTeq or vaccine product is unknown for any dose in the series, a total of 3 doses of RV vaccine should be administered.</span><br></br>
<!--a href="http://www.labwise.in/devel/rotavirus-2/" class="read_more">Read More</a><br/--></td>
<td>
<div class="input-box dob" id="duedtdiv">
<?php
$date=date_create("now");
$bdate=date_create($myDate);
//echo date_format($dueDate,"d F Y");
if($date >= $bdate)
{
$rodueDate=$bdate->modify('+4 month');
echo date_format($rodueDate,"d F Y");
}
else
{
$bdate->modify('+6 month');
echo date_format($bdate,"d F Y");
}
?>
</div>
</td>
</tr>
</table>
</form>
<div>
<button type="submit" name="submit" style="margin-top: 1cm;"title="<?php echo $this->__('Save Form') ?>" value="submit "class="button"><span><span><?php echo $this->__('Save Form')?></span> </span> </button>
</div>
sendmail.php
<?php
//due dates
$myDate=$_POST['myDate'];
$dueDate=$_POST['dueDate'];
$rodueDate=$_POST['rodueDate'];
$didueDate=$_POST['didueDate'];
$pdueDate=$_POST['pdueDate'];
$hadueDate=$_POST['hadueDate'];
$indueDate=$_POST['indueDate'];
$idueDate=$_POST['idueDate'];
$rdueDate=$_POST['rdueDate'];
$vdueDate=$_POST['vdueDate'];
$tdueDate=$_POST['tdueDate'];
$hdueDate=$_POST['hdueDate'];
$mdueDate=$_POST['mdueDate'];
$email=$_POST['email'];
$name=$_POST['name'];
$to=$email;
$subject= "Vaccination Schedule For ".$name;
$message=
'Dear '.$name.',
<p>Date of Birth :'.$myDate.'</p>
<p>Your Vaccination details.</p>'.'
<table border="1" style="width:100%">
<tr>
<th id= "sno" style="font-family: sans-serif; font-size: 100%; font-weight: bold;" class="bg-color" width="5%">S.No</th>
<th id= "vaccine" style="font-family: sans-serif; font-size: 100%; font-weight: bold;" class="bg-color center" width="32%">Vaccine</th>
<th id="duedate" style="font-family: sans-serif; font-size: 100%; font-weight: bold;" class ="bg-color" width="15%">Due Date</th>
</tr>
<tr>
<td>1</td>
<td><a href="http://www.labwise.in/devel/hepatitis-b/" >Hepatitis B</a>
</td>
<td>'.$dueDate.' </td>
</tr>
<td>2</td>
<td><a href="http://www.labwise.in/devel/rotavirus-2/" >Rotavirus2(RV)</a>
</td>
<td> '.$rodueDate.' </td>
</tr>
</table>';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers.= "From: admin@labwise.in" . "\r\n" ;
if( mail($to, $subject, $message, $headers))
{
echo 'Your mail has been sent successfully';
}
else
{
echo 'Unable to send email. Please try again.';
}
?>