title: php - isset button
body: <p>i try to solve a problem but didnt succeed. I retrieve datas from google analytics and i have to send start and end date. I have two textbox and user select start and end date.However, but before user select <img src="https://i.stack.imgur.com/24vQV.png" alt="enter image description here">start and end date. The problem occurs..</p>
  
  <p>The place that i use isset is here,</p>
  
  <p>This is my full html</p>
  
  <pre><code>&lt;?php
  define('ga_email','mertmetinbjk@gmail.com');
  define('ga_password','************');
  define('ga_profile_id','*******');
  
  require 'gapi.class.php';
  require 'connectDB.php';
  
  $ga = new gapi(ga_email,ga_password);
  
  
  
  
  ?&gt;
  
  
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;İçerik&lt;/title&gt;
  &lt;script language="javascript" type="text/javascript" src="datetimepicker.js"&gt;
  
  //Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
  //Script featured on JavaScript Kit (http://www.javascriptkit.com)
  //For this script, visit http://www.javascriptkit.com 
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;body&gt;
      &lt;table align="center"&gt;
          &lt;tr&gt; 
          &lt;td&gt;&lt;br /&gt;
      &lt;br /&gt;
      &lt;form action="#" method="post" name="formDates" id="form1" &gt;
      &lt;table width="303" height="40" border="0" align="center"&gt;
          &lt;table width =""
    &lt;tr&gt;
      &lt;td&gt;Başlangıç Tarihi&lt;/td&gt;
      &lt;td&gt;
        &lt;label for="txtStartDate"&gt;&lt;/label&gt;
        &lt;input type="text" name="txtStartDate" id="txt1" value="" /&gt;&lt;a href="javascript:NewCal('txt1','ddmmyyyy')"&gt;&lt;img src="images/cal.gif" width="16" height="16" border="0" alt="Başlangıç Tarihi Seçin"&gt;
        &lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Bitiş Tarihi&lt;/td&gt;
      &lt;td&gt;
        &lt;label for="txtEndDate"&gt;&lt;/label&gt;
        &lt;input type="text" name="txtEndDate" id="txt2" /&gt;&lt;a href="javascript:NewCal('txt2','ddmmyyyy')"&gt;&lt;img src="images/cal.gif" width="16" height="16" border="0" alt="Bitiş Tarihi Seçin"&gt;
        &lt;/a&gt;
  
      &lt;/td&gt;
    &lt;/tr&gt; 
      &lt;/form&gt;
          &lt;tr&gt;
               &lt;td&gt;&lt;input type="submit" name="btnSubmit" value="Gönder"&lt;/td&gt;
          &lt;/tr&gt;
  
  &lt;/table&gt;
      &lt;table width="1250" height="26" align="center"&gt;
    &lt;tr&gt;
  
      &lt;td width="138"&gt;&lt;strong&gt;Kanal Adı&lt;/strong&gt;
      &lt;td width="150"&gt;&lt;b&gt;Kategori Adı&lt;/b&gt;&lt;/td&gt;
      &lt;td width="130"&gt;&lt;p&gt;&lt;strong&gt;Event Adı&lt;/strong&gt;&lt;/td&gt;
      &lt;td width="145"&gt;&lt;strong&gt;Toplam&lt;/strong&gt;
  
    &lt;/tr&gt;
      &lt;/table&gt;
  
  
  
              &lt;?php
  
              if(isset($_POST['submit'])){     
                  $startDate = $_POST['txtStartDate'];
                  $endDate = $_POST['txtEndDate'];  
               }
  
  
               $arrDates = explode("-",$startDate);
               $startDate=$arrDates[2]."-".$arrDates[1]."-".$arrDates[0];
               $arrDates = explode("-",$endDate);
               $endDate = $arrDates[2]."-".$arrDates[1]."-".$arrDates[0];
  
               echo $startDate;
               echo $endDate;
  
  
  
              $ga-&gt;requestReportData(ga_profile_id,array('eventCategory','eventAction'),array('totalEvents'),$sort_metric=null,$filter='eventAction==InitPlayer',$start_date='2012-02-02',$end_date='2012-02-16');
              foreach($ga-&gt;getResults() as $result2);
              {
                  echo $result2-&gt;geteventCategory();
                  echo $result2-&gt;geteventAction();
                  echo $result2-&gt;gettotalEvents();
              }
  
  
              $ga-&gt;requestAccountData();
              $mysql = new mysql(); 
              $mysql-&gt;connect();  
              $counter = 0;
  
  
  
              foreach($ga-&gt;getResults() as $result)
              {     
                   echo $result . ' (' . $result-&gt;getProfileId() . ")&lt;br /&gt;";
                   echo "&lt;br /&gt;";
                   $counter++;
              }
  
              $result = mysql_query("select profile_id from profiles");
              $num_rows = mysql_num_rows($result);
  
  
  
              if($counter != $num_rows)
              {
                  $mysql-&gt;query("delete from profiles");
  
                  foreach($ga-&gt;getResults() as $result)
                  { 
                     $mysql-&gt;query("insert into profiles values(".$result-&gt;getProfileId().",'".$result."')");
                  }
              }
  
  
  
  
  
  
              ?&gt;
  
  &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>what is wrong?</p>
  
  <p>if a choose start and end date problems is solved , problems occurs before that i choose</p>