title: PHP: Isset with if else statement
body: <p><strong>iso.obj.php</strong></p>
  
  <pre><code>$from = null;
  $too = null;
  
  if (isset($_POST['search'])) {
      if ($from = null) {
          $from = date("Y-m-d");
      } else {
          $from = $_POST['FromDateTime'];
      }
  
      if ($too = null) {
          $too = date('Y-m-d', strtotime("+30 days")) . " 23:59:59"; 
      } else {
          $too = $_POST['ToDateTime']." 23:59:59";
      }
  }
  $sql ="//statement here with
  WHERE capDateTime &gt;='{$from}' AND capDateTime &lt;='{$too}'";
  </code></pre>
  
  <p>The code is working fine but i got problem when person request the page and its return an empty table. But if i select date and time manualy its will display according to the date and time.  </p>
  
  <p>My question is: How do i put current date if not set and if set follow the $_POST?</p>