wie kann ich bei einem option die variable zugreifen wie bei dass bei input type ist?
[Variablen] option
Collapse
X
-
So schon probiert ?
Ansonsten kann ich dir selfhtml zu diesem Thema empfehlen.PHP Code:$var = $_POST['name_des_selects'];
Gruss
tobiGutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten
[color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)
-
so wie bei nem input?!
schon mal mit
alles ausgeben lassen, was über dein Formular so alles an Daten an PHP gesendet wird? vermutlich nicht...sonst hättest du dir die frage sparen könnenPHP Code:echo '<pre>';
print_r($_POST);
echo '</pre>';
Sunshine CMS
BannerAdManagement
Borlabs - because we make IT easier
Formulargenerator [color=red]Neu![/color]
Herkunftsstatistik [color=red]Neu![/color]
Comment
-
ok jetzt mal genau:
so ist es geschrieben nun würde ich dies über switch case ausgeben, die frage ist halt :PHP Code:<select name="Namen" size="1" >
<optgroup label="Spieltag auswählen" id="A">
<option value="1" name="1" label="1" > 1. Spieltag</option>
<option value="2" label="2">1 2. Spieltag</option>
<option value="3" label="3"> 3. Spieltag</option>
<option value="4" label="4"> 4. Spieltag</option>
<option label="5"> 5. Spieltag</option>
</optgroup>
</select>
switch($vaue) oder wie?????
sio wie beim button:
switch($submit) funktioniert
Comment
-
Schon probiert ????PHP Code:switch($_POST['Namen']){
....
}
Gruss
tobiGutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten
[color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)
Comment
-
Was funzt nicht...
Da geh ich aber jede Wette ein das des funktioniert. Es sei denn du hast ein GET Formular oder ein total verdrehtes PHP...PHP Code:switch($_POST["Namen"])
{
case "1":
echo "Erster Spieltag ausgewählt";
break;
case "2":
echo "Erster Spieltag ausgewählt";
break;
}
gruss Chris
[color=blue]Derjenige, der sagt: "Es geht nicht", soll den nicht stoeren, der's gerade tut."[/color]
Comment
-
Methode ist post aber mit dem option hab ich meine probleme wie kann ich dass ansprechen?
ist da name oder label oder was ganz anderes korrekt um dann im php ode darauf zuzugreifen, also auf die 1 oder 2 oder 3 oder 4 für den jeweiligen spieltag?PHP Code:<select name="Namen" size="1" >
<optgroup label="Spieltag auswählen" id="A">
<option name="1"> 1. Spieltag</option>
<option name="2"> 2. Spieltag</option>
<option name="3"> 3. Spieltag</option>
<option name="4" > 4. Spieltag</option>
<option name="5"> 5. Spieltag</option>
<option label="6"> 6. Spieltag</option>
<option label="7"> 7. Spieltag</option>
<option label="8"> 8. Spieltag</option>
<option label="9"> 9. Spieltag</option>
<option label="10"> 10. Spieltag</option>
<option label="11"> 11. Spieltag</option>
<option label="12"> 12. Spieltag</option>
<option label="13"> 13. Spieltag</option>
<option label="14"> 14. Spieltag</option>
<option label="15"> 15. Spieltag</option>
<option label="16"> 16. Spieltag</option>
<option label="17"> 17. Spieltag</option>
</optgroup>
</select>
Comment
-
ok danke das dachte ich mir erst schon kanm aber etwas durcheinander, nun will ich einen query einbauen und den dann über ne whileschleife ausgeben, aber :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/vhosts/5000130433/svschwabelweis.de/htdocs/1mannschaft/spielplan.php on line 92
...PHP Code:
case "1":
$sql = "SELECT man1, man2, tore1, tore2 from paarung ";
echo "Erster Spieltag ausgewählt";
break;
PHP Code:
while($row = mysql_fetch_array($sql)) {
echo $row["man1"] . " - " . $row["man2"] . " " . $row["tore1"] . " : " .
$row["tore2"] . "<br />" . "<br />";
}
Comment
-
I don't believe in rebirth. Actually, I never did in my whole lives.
Comment
-
PHP Code:// ......
$sql = "SELECT man1, man2, tore1, tore2 from paarung ";
//....... Du meinst nicht hier fehlt noch was?
//....... Grundlagen lernen......
while($row = mysql_fetch_array($sql)) { // $sql is auch völliger Quatsch
gruss Chris
[color=blue]Derjenige, der sagt: "Es geht nicht", soll den nicht stoeren, der's gerade tut."[/color]
Comment
-
ach man tut mir mal wieder sehr leid dass ich eure zeit in anspruch nehmen muss, mein großes problem:leichtsinn:
da schreib ich doch tatsächlich:
statt:PHP Code:$sql = "SELECT man1, man2, tore1, tore2 from paarung ";
wie gesagt war dumm und leichtsinnig von mir ich sollte erste meine code immer genau anschaune bevor ich was poste, sorry nochmal aber recht herzlichen dank für die hilfe!!!PHP Code:$sql = @mysql_query("SELECT man1, man2, tore1, tore2 from paarung ");
Comment
-
Jetz machs direkt GANZ richtig...
PHP Code:$sql = @mysql_query("SELECT man1, man2, tore1, tore2 from paarung ");
// Ändern in
$sql = mysql_query("SELECT man1, man2, tore1, tore2 from paarung ") or die("Fehler: ".mysql_error());
gruss Chris
[color=blue]Derjenige, der sagt: "Es geht nicht", soll den nicht stoeren, der's gerade tut."[/color]
Comment

Comment