<?php
// Don not use the <?php ?> closures for the input

$date = $_GET['date'];

if(isset($date)) { 
  $query= $date;
}
else {
  // Get the current date (today)
  $query = date('Y-m-d');
}

return $query;

?>