Dateigrösse: 3.09 kb
1<?php function erzeugeSelect($sel_name,$arr,$sel_item,$first='',$auto_submit='1') { $menu = '<select name="'.$sel_name.'" size="1"'; $menu .= $auto_submit == '1' ? ' onchange="this.form.submit();" onfocus="this.style.backgroundColor=\'#ffffff\'" >'."\n" : '>'."\n"; $menu .= $first == '' ? '' : '<option value="-1">'.$first.'</option>'."\n"; foreach ($arr as $schluessel => $wert) { $selected = $sel_item == $schluessel ? ' selected="selected"' : ''; $menu .= '<option value="'.$schluessel.'"'. $selected.'>'.$wert.'</option>'."\n"; } $menu .= '</select>'."\n"; return $menu; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>DaF-Uebungen:::Aufklapp-Menu</title> <meta name="keywords" content="DaF, Fremdsprache Deutsch, Lueckentext, Grammatiktest, Deutschtest, Test, Multiple Choice, Michael Steiner, EB, EB Zürich"> <link rel="SHORTCUT ICON" href="../img/favicon.ico" title="external:/favicon.ico"> <style type="text/css"> body { background-color:#f8f8ff; font-family:verdana,arial; font-size:12px; padding:0px; padding-top:0px; margin:0px; overflow:hidden; } #header { position:absolute; top:0px; left:0px; width:240px; padding: 10px 0px 0px 33px; margin: 0px; font-size: 12px; font-weight: bold; background-color:transparent; z-index:15; } #sel_test { position:absolute; top:0px; left:240px; width:300px; padding: 5px 0px; margin: 0px; font-size: 12px; background-color:transparent; z-index:10; } iframe { position:absolute; top:25px; left:0px; width:100%; height:100%; border-top:1px solid #000000; padding: 0px; background-color: #ffffff; margin:0px; z-index:5; } form { margin:0px; padding:0px; } #sel_test select { font-family:verdana; font-size:12px; background-color:yellow; border:1px solid #000000; font-weight: bold; letter-spacing:1.5px; } </style> </head> <body> <?php $sel_name = 'uebungen'; $arr = array( "gegenteil.php" => "Adjektive ::: Gegenteil", "adjektivendung.php" => "Adjektive ::: Endungen", "rb.php" => "Multiple Choice Test", "perfekt.php" => "Perfekt I", "perfekt_2.php" => "Perfekt II", "artikel.php" => "Artikel", "kueche_einrichten.php" => "Tischlein deck' dich !", "papamoll_ddrop.php" => "Papa Moll", ); $sel_item = isset($_POST['uebungen']) ? $_POST['uebungen'] : 'perfekt.php'; $n = '<div id="sel_test">'; $n .= '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="n">'; $n .= erzeugeSelect($sel_name,$arr,$sel_item); $n .= '</form>'; $n .= '</div>'; echo $n; echo '<br><br>'; ?> <div id="header">Wählen Sie eine neue Übung:</div> <iframe name="iframe" width="100%" src="<?php echo $sel_item; ?>" scrolling="auto" frameborder="0"> <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen:<br><br> Sie können die eingebettete Seite über den folgenden Verweis aufrufen: <a href="<?php echo $sel_item; ?>"><?php echo $arr[$sel_item]; ?></a></p> </iframe> </body> </html>