Select the option using the value from a SESSION, not working
<p>I'm trying to give the selected attribute to the year that is stored in a SESSION ( in the script I posted the date 1990-06-27 is the SESSION I'm talking about ). Everything goes well for $month but when I do the same If statement for $year is not working and I really have no idea why.</p>

<pre><code>list($y,$m,$d)=explode('-', "1990-06-27");     
for($month=1; $month&lt;=12; $month++) {
    $monthName = date("F", mktime(0, 0, 0, $month));
    $month = date("m", mktime(0, 0, 0, $month));
    $luni = array ('January' =&gt; 'Ianuarie', 'February' =&gt; 'Februarie', 'March' =&gt;     'Martie', 'April' =&gt; 'Aprilie', 'May' =&gt; 'Mai', 'June' =&gt; 'Iunie', 'July' =&gt; 'Iulie', 'August' =&gt; 'August', 'September' =&gt; 'Septembrie', 'October' =&gt; 'Octombrie', 'November' =&gt; 'Noiembrie', 'December' =&gt; 'Decembrie');
        If($m === $month) { 
            $selected = 'selected="selected"';
            $monthOptions .= "&lt;option value=\"{$month}\" $selected&gt;{$luni[$monthName]}&lt;/option&gt;\n";
        } else {
            $monthOptions .= "&lt;option value=\"{$month}\"&gt;{$luni[$monthName]}&lt;/option&gt;\n";
        }
}

$an_curent = date("Y", time());
for($year = $an_curent - 80; $year &lt;= $an_curent - 16; $year++) {
    If($y === $year) { 
        $selected = 'selected="selected"';
        $yearOptions .= "&lt;option value=\"{$year}\" $selected&gt;{$year}&lt;/option&gt;\n";  
    } else {
        $yearOptions .= "&lt;option value=\"{$year}\"&gt;{$year}&lt;/option&gt;\n";  
    }
}
</code></pre>
