too long

I have two form

<form name='theForm' id='theForm' method="post">

and

<form id="frmDate" action="?page=absensi" method="post">

I submit first form with this

<input type="radio" name="keterangan" value="Hadir"  onChange="theForm.submit();" />

Second form with this

        <script type="text/javascript"> 
        jQuery(function(){ 
            $('#tgl').daterangepicker({
                arrows:true,
                onChange: function(){
                    $('#frmDate').submit();
                }//removed comma here
            });
         });

    </script>

I already can get variable from one of forms with this

<?php
$keterangan = "";
$date1      = "";
$date2      = "";
if(isset($_POST["keterangan"])){
$keterangan = $_POST["keterangan"];
 }
elseif(isset($_POST["tgl"])){
$dates = explode("-",$_POST[tgl] );
$date1=  date("Y-m-d", strtotime($dates[0]));
if ($dates[0] == $_POST[tgl]){
        $date2 = $date1;
}
else{
$date2=  date("Y-m-d", strtotime($dates[1]));}
} ?>

But I don't know how to get variable from forms when one of them already submit. I have try to manipulate code with this:

<?php
if(isset($_POST["keterangan"])){
$keterangan = $_POST["keterangan"];
    if(isset($_POST["tgl"]) and $keterangan<>''){
       $dates = explode("-",$_POST[tgl] );
   $date1=  date("Y-m-d", strtotime($dates[0]));
   if ($dates[0] == $_POST[tgl]){
        $date2 = $date1;
   }
   else{
   $date2=  date("Y-m-d", strtotime($dates[1]));}
       }
 }
elseif(isset($_POST["tgl"])){
$dates = explode("-",$_POST[tgl] );
$date1=  date("Y-m-d", strtotime($dates[0]));
if ($dates[0] == $_POST[tgl]){
        $date2 = $date1;
}
else{
$date2=  date("Y-m-d", strtotime($dates[1]));}
    if(isset($_POST["keterangan"]) and $date1<>'' and $date2<>''){
$keterangan = $_POST["keterangan"];}
} ?>

please help me out from my problem. thanks

Use one form instead of two separated and handle the cases on the backend. You can't read the state of one form if another was submitted.

HTTP is stateless. If you submit a form, you lost the data of the second form. You must use only one form.