1 2 3 4 | < label style = "float:left; width:35%;" >{_lang_birthday}</ label > < select style = "margin-bottom:2px; width:50px" name = "day" />{_list_day@< option %1 value = "%2" >%3</ option >}</ select > < select style = "margin-bottom:2px; width:150px" name = "month" />{_list_month@< option %1 value = "%2" >%3</ option >}</ select > < select style = "margin-bottom:2px; width:100px" name = "year" />{_list_year@< option %1 value = "%2" >%3</ option >}</ select > |
In der dazugehörigen .php habe ich die habe ich folgende Zeilen geschrieben:
19 20 21 22 23 24 25 26 27 28 29 30 | if ( empty ( $_POST [ 'submit' ]) || ! $csrfCheck ) { $design ->header(); $abf = 'SELECT email,wohnort,homepage,aim,msn,icq,yahoo,avatar,status,staat,gebdatum,sig,opt_pm_popup,opt_pm,opt_mail,geschlecht,spezrank FROM `prefix_user` WHERE id = "' . $_SESSION [ 'authid' ]. '"' ; $erg = db_query( $abf ); if ( db_num_rows( $erg ) > 0 ) { $row = db_fetch_assoc( $erg ); $tpl = new tpl ( 'user/profil_edit' ); $t = explode ( '-' , $row [ 'gebdatum' ]); $row [ 'day' ] = '<option></option>' .arlistee ( $t [0] , set_day() , $tpl , 'day' ); $t [ 'month' ] = '<option></option>' .arlistee ( $t [1] , set_month() , $tpl , 'month' ); $row [ 'year' ] = '<option></option>' .arlistee ( $t [2] , set_year() , $tpl , 'year' ); |
Die Funktionen set_day usw.. sehen so aus:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | function set_year () { $ar = array ( '' => '' , '0000' => '' , '2015' => '2015' , '2014' => '2014' , '2013' => '2013' , '2012' => '2012' , '2011' => '2011' , ... '1951' => '1951' , '1950' => '1950' ); return ( $ar ); } |
Weiter unten werden die Werte korrekt in Datenbank übernommen. Habe das auch schon geprüft.
Mein Problem ist nur das, dass im Auswahlfeld "month" der richtige Monat ausgewählt wird, so wie er in der Datenbank steht und in den Auswahlfeldern "day" und "year" immer neu eingetragen werden muss.
Sprich die Ausgabe für die beiden Felder passt nicht. Kann das am "$t = explode" liegen?
verwendete ilch Version: 1.1 P