issue with if condition for variable
<p>I have two parameters in my stored procedure i.e. @startdate and @enddate. The user selects startdate from text box and enddate also from text box. Then click submit.</p>

<p>I want to make sure if user leaves blank both the boxes, it should display data for the whole current month i.e. 01/08/2012 to 31/08/2012 now.</p>

<p>If user just selects date in any one of the boxes, the other text box should have the same value.</p>

<p>So I have declared variable as below and tried the condition but it always display data for whole month irrespective of what date is selected. I think there is a problem with my if condition.</p>

<pre><code>$startdate = isset($_REQUEST['startdate']) ? $_REQUEST['startdate'] : null;
$enddate   = isset($_REQUEST['enddate']) ? $_REQUEST['enddate'] : null;
if (empty($startdate)) {
    $startdate = $enddate;
}
if (empty($enddate)) {
    $enddate   = $startdate;
}
if (empty($startdate))
    ;
if (empty($enddate))
    ;
$startdate = '01/08/2012';
$enddate   = '31/08/2012';
</code></pre>
