0

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.';
   }

 ?> 
1
Contributor
1
Reply
5
Views
2 Years
Discussion Span
Last Post by Ravinder_3
0

Congratulations! You're no longer a DaniWeb newbie.<br /> <br />
Your DaniWeb account has just been upgraded from newbie status and now you have the ability to take advantage of everything the community has to offer.<br /> <br />
You can now enjoy an advertisement-free DaniWeb by ticking the checkbox to Disable Ads in your profile. You will no longer have to fill out the human verification check when you post. You can also now send unlimited private messages, participate in live chat, opt-in to mailing list-style notifications which allows you to read and contribute posts via email, contribute new code snippets, contribute editorial, access Area 51 and tag articles with never-before-used tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.