Moin Moin,
ich hab eine html: (pizza.html)
und dann eine php Datei: (pizza.php)
Die Variable $pizza wir nicht in die best.html geschrieben. Der Rest funktioniert ohne Probleme, also Name und Sitzplatz.
Kann mir da jemand helfen???
Danke schon mal im vorraus
ich hab eine html: (pizza.html)
Code:
<center><h2><b>Pizza-Bestellung</b></h2></center><hr><br><br>Bitte fülle die folgenden Felder aus, um eine Bestellung aufzugeben:<br><br><form name="bestellung" action="pizza.php" method="post"> <table border=1 bordercolor=black cellspacing=0 cellpadding=0 align=left> <tr align=left><th bgcolor=beige>Vor-/Nachnahme:</th><th bgcolor=white><input type="text" name="name"></th></tr> <tr align=left><th bgcolor=beige>Sitzplatz Nr.:</th><th bgcolor=white><input type="text" name="sitz" size=4></th></tr> </table><br><br><br><br> <B><u>Bestellung:</b></u> <br><br> <table border=1 bordercolor=black cellspacing=0 align=left width=70%> <tr align=center> <th width=15% bgcolor=orange>Anzahl:</th><th bgcolor=orange width=85%>Pizza-Typ</th></tr> <tr align=left><th bgcolor="white" width=15%> <input type="text" maxlenght=1 size=12 name="anzahl"></th><th bgcolor="white" width=85%> <input type="text" name="pizza" size=90></th></tr> <tr><th></table><br><br><br><br> <input type="submit" name="subbi" value="weiter">
PHP-Code:
<?PHP
$nname = isset($HTTP_POST_VARS['name']) ? $HTTP_POST_VARS['name'] : '';
$nnr = isset($HTTP_POST_VARS['sitz']) ? $HTTP_POST_VARS['sitz'] : '';
$anzahl = isset($HTTP_POST_VARS['anzahl']) ? $HTTP_POST_VARS['anzahl'] : '';
$pizza = isset($HTTP_POST_VARS['pizza']) ? $HTTP_POST_VARS['pizza'] : '';
echo "<html><body bgcolor=white><font face=verdana><center><h2><b>";
echo "Pizza-Bestellung</b></h2></center><hr><br>";
echo "Bitte überprüfe deine Bestellung nocheinmal auf ihre Richtigkeit:";
echo "<br><br><i>Name:</i><b> $nname</b><br>";
echo "<i>Sitzplatz Nr.:</i><b> $nnr</b><br>";
echo "<i>Bestellung:</i><b> $anzahl,  $pizza</b><br>";
echo "<br><br><form name=best action=pizza.php method=post>";
echo "Sind diese Angaben richtig?<br><br>";
echo "<input type=radio name=check value=richtig><i>Alles OK ";
echo "<input type=radio name=check value=falsch><i>Da ist was falsch...";
echo "<input type=submit value=bestellen>";
$check = isset($HTTP_POST_VARS['check']) ? $HTTP_POST_VARS['check'] : '';
if($check == "richtig")
{
$fp = fopen ("best.html", "w");
if (!$fp) {
echo "Fehler beim öffnen der Datei!";
exit;
}
$nname = isset($HTTP_POST_VARS['name']) ? $HTTP_POST_VARS['name'] : '';
$nnr = isset($HTTP_POST_VARS['sitz']) ? $HTTP_POST_VARS['sitz'] : '';
$anzahl = isset($HTTP_POST_VARS['anzahl']) ? $HTTP_POST_VARS['anzahl'] : '';
$pizza = isset($HTTP_POST_VARS['pizza']) ? $HTTP_POST_VARS['pizza'] : '';
fputs ($fp, $pizza);
fclose ($fp);
$right = "1";
}
if($right == "1")
{
echo "<html><body><center><h2><b>Vielen Dank für die Bestellung!!!";
echo "</b></h2></center></body></html>";
}
else
{
echo "<html><body><center><h2><b>";
echo"</b></h2></center></body></html>";
}
?>
Die Variable $pizza wir nicht in die best.html geschrieben. Der Rest funktioniert ohne Probleme, also Name und Sitzplatz.
Kann mir da jemand helfen???
Danke schon mal im vorraus
Kommentar