Hi,
ich versuche derzeit, ein Selectfeld aus einem Array zu generieren.
Der derzeitige Funktionscode ist:
	
am Ende soll eben das Selectfeld den Eintrag mit dem Wert $auth_level als Vorbelegung erhalten. Doch das Selectfeld, das erzeugt wird, ist leer.
Woran liegt das?
					ich versuche derzeit, ein Selectfeld aus einem Array zu generieren.
Der derzeitige Funktionscode ist:
PHP Code:
	
	
 //
 // Auth Selection generate
 //
function auth_select($auth_level, $select_name = 'auth')
{
$auth_select = '<select name="' . $select_name . '">';
$auths = array('ALL' => -1, 'REG' => 0, 'MOD' => 2, 'ADMIN' => 1);
while( list($output, $auth_id) = @each($auths[]) )
{
    if( $auth_id == $auth_level)
    {
        $auth_select = "<option value=" . $auth_id . " selected=selected>" . $output . "</option>";
    }
    else
    {
        $auth_select = "<option value=" . $auth_id . ">" . $output . "</option>";
    }
}
$auth_select .= '</select>';
return $auth_select;
} 
Woran liegt das?
          
Comment