Halli Hallo,
normalerweise nutze ich immer vorgefertigte Scripte, die ich dann modifiziere, doch ich will es selbst lernen.
Auf der Lern-DVD kommt das Kapitel "Formulare", wo ich Folgendes so gelernt habe:
Und hier die Ausgabe:
So erklärt man es, aber ich bekomme dann folgende Fehler:
Wo ist denn mein Fehler? Soweit ich weiß, habe ich alle Variablen gegeben.
Die Lern DVD ist schon ein paar Jahre alt.
Macht man es heute vielleicht nicht mehr so?
Meine verwendeten Formulare sind auch alle anders geschrieben.
Edit: Entschuldigt die Variablen. :-[ So lern ich schneller. xD
normalerweise nutze ich immer vorgefertigte Scripte, die ich dann modifiziere, doch ich will es selbst lernen.
Auf der Lern-DVD kommt das Kapitel "Formulare", wo ich Folgendes so gelernt habe:
HTML:
<form method="post" action="index2.php">
<table callpadding="2">
<tr>
<td>Name</td>
<td><input type="text" name="form_name" size="24"></td>
</tr>
<tr>
<td>Vorname</td>
<td><input type="text" name="form_vorname" size="24"></td>
</tr>
<tr>
<td>Straße</td>
<td><input type="text" name="form_street" size="24"></td>
</tr>
<tr>
<td>Geburtsdatum</td>
<td><input type="text" name="form_birth" size="24"></td>
</tr>
<tr>
<td>Geschlecht</td>
<td>
<input type="radio" name="form_geschlecht" value="mann">männlich
<input type="radio" name="form_geschlecht" value="frau">weiblich
</td>
</tr>
<tr>
<td>Gangsta</td>
<td>
<select name="form_gangsta" size="3">
<option>aJunkie</option>
<option>Yanik</option>
<option>Ficker</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" name="senden" value="Senden"></td></tr>
</table>
</form>
HTML:
<table callpadding="2">
<tr>
<td>Name</td>
<td><?php echo $HTTP_POST_VARS["form_name"]; ?></td>
</tr>
<tr>
<td>Vorname</td>
<td><?php echo $HTTP_POST_VARS["form_vorname"]; ?></td>
</tr>
<tr>
<td>Straße</td>
<td><?php echo $HTTP_POST_VARS["form_street"]; ?></td>
</tr>
<tr>
<td>Geburtsdatum</td>
<td><?php echo $HTTP_POST_VARS["form_birth"]; ?></td>
</tr>
<tr>
<td>Geschlecht</td>
<td><?php echo $HTTP_POST_VARS["form_geschlecht"]; ?></td>
</tr>
<tr>
<td>Gangsta</td>
<td>
<?php
foreach ($HTTP_POST_VARS["form_gangsta"] as $ficker);
{
echo $ficker . "<br>";
}
?>
</td>
</tr>
</table>
PHP:
Name
Notice: Undefined variable: HTTP_POST_VARS in C:\wamp\www\training\index2.php on line 23
Vorname
Notice: Undefined variable: HTTP_POST_VARS in C:\wamp\www\training\index2.php on line 27
Straße
Notice: Undefined variable: HTTP_POST_VARS in C:\wamp\www\training\index2.php on line 31
Geburtsdatum
Notice: Undefined variable: HTTP_POST_VARS in C:\wamp\www\training\index2.php on line 35
Geschlecht
Notice: Undefined variable: HTTP_POST_VARS in C:\wamp\www\training\index2.php on line 39
Gangsta
Notice: Undefined variable: HTTP_POST_VARS in C:\wamp\www\training\index2.php on line 45
Warning: Invalid argument supplied for foreach() in C:\wamp\www\training\index2.php on line 45
Notice: Undefined variable: ficker in C:\wamp\www\training\index2.php on line 47
Die Lern DVD ist schon ein paar Jahre alt.
Macht man es heute vielleicht nicht mehr so?
Meine verwendeten Formulare sind auch alle anders geschrieben.
Edit: Entschuldigt die Variablen. :-[ So lern ich schneller. xD