Formular select box

makitaman

Mitglied
Hi Leute ich hänge Momentan an einem Problem
ich möchte ein kleines Email Formular erstellen.
eine kleines Select formular mit 2 einstellmöglichkeiten
so:
PHP:
<select  name="wahl"  size="1">
<option value="null">Hier ausw&auml;hlen</option>
<option value="b120">120 Minuten</option>
<option value="b60">60 Minuten</option>
<option value=" "> </option>
</select>

und jetzt hackts schon. man kann zwar 2 Sachen auswählen.
Das ist klar.
wie mache ich das, das z.B. bei b120 Auswahl das formular zum thema 120 gesendet wird.
please help
 
wie mache ich das, das z.B. bei b120 Auswahl das formular zum thema 120 gesendet wird.
please help

Ich weiß nicht ob ich deine Frage richtig verstanden habe. Vielleicht so:

Code:
<?php
if (isset($_POST['wahl']))
{
    if ('b120' == $_POST['wahl'])
    {
        formular120();
    } else if ('b60' == $_POST['wahl'])
    {
        formular60();
    } else {
        echo "Bitte wählen Sie eine Option<br>";
        auswahl();
    }
} else {
    auswahl();
}

function auswahl()
{
?>
<form method="post">
<select  name="wahl"  size="1">
<option value="null">Hier ausw&auml;hlen</option>
<option value="b120">120 Minuten</option>
<option value="b60">60 Minuten</option>
</select>
<input type="submit">
</form>
<?php
}

function formular120()
{
    echo "Formular 120<br>";
}

function formular60()
{
    echo "Formular 60<br>";
}


Marian
 
Zurück