Hopsel: datumsabfrage einschränken

Beitrag lesen

Hi junior!

Weiß jemand von euch, wo mein Fehler liegt? hab jetzt

$filteryear = date("Y");
$_POST['year'] = $filteryear;
....
for ($i = $filteryear-5; $i <= $filteryear+5; $i++) {
                if (isset($_POST['year']) and $_POST['year'] == $i) {
                        echo "<option selected>$i</option>\n";
                } else {
                        echo "<option>$i</option>\n";
                }
        }

Wieso speicherst du in das superglobale Array $\_POST das aktuelle Jahr. Du hast dieses Jahr doch schon in `$filteryear`{:.language-php} stehen.  
  

> Wo ist das Problem? Wäre um jede kleine Hilfe sehr, sehr dankbar  

Das Problem tritt vor allem mit vorliegendem Code nicht auf.  
  
Was meinst du mit "erneutem Auswählen"?  
  
MfG H☼psel

-- 
"It's amazing I won. I was running against peace, prosperity, and incumbency."  
George W. Bush speaking to Swedish Prime Minister unaware a live television camera was still rolling, June 14, 2001  
  
[Selfcode](http://community.de.selfhtml.org/fanprojekte/selfcode.htm): ie:% fl:( br:> va:) ls:& fo:) rl:? n4:& ss:| de:] js:| ch:? sh:( mo:) zu:)