Hallo Ihr (BrainBug?),
Komme mal wieder nicht weiter. Bin immer noch an arbeiten meines Warenkorb, doch nun ist es entlich soweit das ich die Bestellung auch per Mail senden will, doch hier weiß ich nicht weiter. Ich postet euch mal das PHP-Script und die HTML-Ausgabe.
PHP-Script:
<?php
include("../inc/db_data.inc.php");
include("../inc/config.inc.php");
include("../inc/function.inc.php");
// include("../inc/kurb.inc.php");
Init_Shop();
$ffa = "font face='$ff' size='2'";
$ffa1 = "font face='$ff' size='1'";
$ffe = "/font";
print "<html>";
print "<head>";
print "<meta http-equiv='Content-Language' content='de'>";
print "<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>";
print "<meta name='GENERATOR' content='PFE 32'>";
print "<title>$title</title>";
print "</head>";
print "<body bgcolor='$bgc' link='$sfl' alink='$sfa' vlink='$sfb'>";
$db = mysql_connect("$MySQL_Host","$MySQL_User","$MySQL_Passw") or die (mysql_error());
mysql_select_db("$MySQL_Data");
$res = mysql_query("SELECT * FROM korb where SessionID='$sid'") or die (mysql_error());
$num = mysql_num_rows($res);
if ($num == 0)
{
print "<font face='$ff' size='2'>Ihr Warenkorb ist leer.</font>";
}
else
{
print "<$ffa>Lieferanschrift<$ffe><br><br>";
print "<table width='50%' border='0'>";
print "<tr><td width='15%'><$ffa>Vorname:<$ffe></td><td width='35%'><input type='text' name='Vorname'></td></tr>";
print "<tr><td width='15%'><$ffa>Nachname:<$ffe></td><td width='35%'><input type='text' name='Nachname'></td></tr>";
print "<tr><td width='15%'><$ffa>Strasse:<$ffe></td><td width='35%'><input type='text' name='Strasse'></td></tr>";
print "<tr><td width='15%'><$ffa>Postleitzahl:<$ffe></td><td width='35%'><input type='text' name='PLZ'></td></tr>";
print "<tr><td width='15%'><$ffa>Ort:<$ffe></td><td width='35%'><input type='text' name='Ort'></td></tr>";
print "<tr><td width='15%'><$ffa>Telefon:<$ffe></td><td width='35%'><input type='text' name='Telefon'></td></tr>";
print "<tr><td width='15%'><$ffa>Fax:<$ffe></td><td width='35%'><input type='text' name='Fax'></td></tr>";
print "<tr><td width='15%'><$ffa>eMail:<$ffe></td><td width='35%'><input type='text' name='eMail'></td></tr>";
print "</table>";
print "<br><$ffa>Ihr Warenkorb:<$ffe><br>";
print "<table width='100%' border='0'>";
print "<tr><td width='10%' bgcolor='#99CCFF'><$ffa>Position<$ffe></td><td width='20%' bgcolor='#99CCFF'><$ffa>Artikelnummer<$ffe></td><td width='40%' bgcolor='#99CCFF'><$ffa>Artikelname<$ffe></td><td width='10%' bgcolor='#99CCFF'><$ffa>Menge<$ffe></td><td width='20%' bgcolor='#99CCFF'><$ffa>Preis<$ffe></td><td bgcolor='#99ccff' colspan='2'> </td></tr>";
for ($i=0; $i<$num; $i++)
{
$sid = mysql_result($res, $i, "SessionID");
$Anr = mysql_result($res, $i, "ArtikelNR");
$An = mysql_result($res, $i, "ArtikelName");
$Me = mysql_result($res, $i, "Menge");
$Pr = mysql_result($res, $i, "Preis");
$lf = $i + 1;
$ges = $Me*$Pr;
print "<tr><td width='10%'><$ffa>$lf<$ffe></td><td width='20%'><$ffa>$Anr<$ffe></td><td width='40%'><$ffa>$An<$ffe></td><td width='10%'><$ffa>$Me<$ffe></td><td width='20%'><$ffa>". number_format($ges,2) ." €<$ffe></td><td><$ffa1>";
print "<form action='anzahl.php' method='POST'>";
print "<input type='hidden' name='F1' value='$sid'>";
print "<input type='hidden' name='F2' value='$Anr'>";
print "<input type='hidden' name='F3' value='$An'>";
print "<input type='Submit' name='anzahl' value='+' style='font-family: $ff; font-size: 8pt'>Menge<$ffe></form></td><td><$ffa1>";
print "<form action='entfernen.php' method='POST'>";
print "<input type='hidden' name='F1' value='$sid'>";
print "<input type='hidden' name='F2' value='$Anr'>";
print "<input type='hidden' name='F3' value='$An'>";
print "<input type='hidden' name='F4' value='$Pr'>";
print "<input type='Submit' name='loeschen' value='-' style='font-family: $ff; font-size: 8pt'>löschen<$ffe></form></td></tr>";
}
print "<tr><td width='10%'> </td><td width='20%'> </td><td width='40%'> </td><td width='10%'><$ffa>Gesamtsumme: <$ffe></td><td width='20%'><u>";
$db1 = mysql_connect("$MySQL_Host", "$MySQL_User", "$MySQL_Passw");
mysql_select_db("$MySQL_Data");
$korbsumme=mysql_query("select sum(Menge*Preis) as gesamt from korb where SessionID='$sid'");
$gesamt=mysql_result($korbsumme,0,"gesamt");
print "<$ffa><b>$gesamt €</b></u><$ffe></td></tr>";
mysql_close($db1);
print "</table>";
print "<br><br>";
print "<table width='30%' border='0'>";
print "<tr><td width='50%'><form action='bestellen.php' method='POST'><input type='submit' name='bestellen' value='bestellen' style='font-family: $ff; font-size: 8pt'><input type='hidden' name='F1' value='$sid'></form></td><td width='50%'><form action='korbleer.php' method='POST'><input type='SUBMIT' name='leeren' value='Warenkorb löschen' style='font-family: $ff; font-size: 8pt'><input type='hidden' name='F1' value='$sid'></form></td></tr>";
print "</table>";
}
mysql_close($db);
print "</body>";
print "</html>";
?>
HTML Ausgabe
<html>
<head>
<meta http-equiv='Content-Language' content='de'>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>
<meta name='GENERATOR' content='PFE 32'>
<title>PHP-Shop Test</title>
</head>
<body bgcolor='#ffffff' link='#000000' alink='#000000' vlink='#000000'>
<font face='Comic Sans MS' size='2'>Lieferanschrift</font><br><br>
<table width='50%' border='0'>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Vorname:</font></td><td width='35%'><input type='text' name='Vorname'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Nachname:</font></td><td width='35%'><input type='text' name='Nachname'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Strasse:</font></td><td width='35%'><input type='text' name='Strasse'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Postleitzahl:</font></td><td width='35%'><input type='text' name='PLZ'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Ort:</font></td><td width='35%'><input type='text' name='Ort'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Telefon:</font></td><td width='35%'><input type='text' name='Telefon'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Fax:</font></td><td width='35%'><input type='text' name='Fax'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>eMail:</font></td><td width='35%'><input type='text' name='eMail'></td></tr>
</table>
<br><font face='Comic Sans MS' size='2'>Ihr Warenkorb:</font><br>
<table width='100%' border='0'>
<tr><td width='10%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Position</font></td><td width='20%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Artikelnummer</font></td><td width='40%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Artikelname</font></td><td width='10%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Menge</font></td><td width='20%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Preis</font></td><td bgcolor='#99ccff' colspan='2'> </td></tr>
<tr><td width='10%'><font face='Comic Sans MS' size='2'>1</font></td><td width='20%'><font face='Comic Sans MS' size='2'>00001</font></td><td width='40%'><font face='Comic Sans MS' size='2'>Kaffetasse</font></td><td width='10%'><font face='Comic Sans MS' size='2'>1</font></td><td width='20%'><font face='Comic Sans MS' size='2'>20.50 €</font></td><td><font face='Comic Sans MS' size='1'><form action='anzahl.php' method='POST'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'><input type='hidden' name='F2' value='00001'><input type='hidden' name='F3' value='Kaffetasse'><input type='Submit' name='anzahl' value='+' style='font-family: Comic Sans MS; font-size: 8pt'>Menge</font></form></td><td><font face='Comic Sans MS' size='1'><form action='entfernen.php' method='POST'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'><input type='hidden' name='F2' value='00001'><input type='hidden' name='F3' value='Kaffetasse'><input type='hidden' name='F4' value='20.50'><input type='Submit' name='loeschen' value='-' style='font-family: Comic Sans MS; font-size: 8pt'>löschen</font></form></td></tr>
<tr><td width='10%'> </td><td width='20%'> </td><td width='40%'> </td><td width='10%'><font face='Comic Sans MS' size='2'>Gesamtsumme: </font></td><td width='20%'><u><font face='Comic Sans MS' size='2'><b>20.50 €</b></u></font></td></tr>
</table>
<br><br>
<table width='30%' border='0'>
<tr><td width='50%'><form action='bestellen.php' method='POST'><input type='submit' name='bestellen' value='bestellen' style='font-family: Comic Sans MS; font-size: 8pt'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'></form></td><td width='50%'><form action='korbleer.php' method='POST'><input type='SUBMIT' name='leeren' value='Warenkorb löschen' style='font-family: Comic Sans MS; font-size: 8pt'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'></form></td></tr>
</table>
</body>
</html>
Wer kann mir hier weiterhelfen?
cu
Gilbert
Komme mal wieder nicht weiter. Bin immer noch an arbeiten meines Warenkorb, doch nun ist es entlich soweit das ich die Bestellung auch per Mail senden will, doch hier weiß ich nicht weiter. Ich postet euch mal das PHP-Script und die HTML-Ausgabe.
PHP-Script:
<?php
include("../inc/db_data.inc.php");
include("../inc/config.inc.php");
include("../inc/function.inc.php");
// include("../inc/kurb.inc.php");
Init_Shop();
$ffa = "font face='$ff' size='2'";
$ffa1 = "font face='$ff' size='1'";
$ffe = "/font";
print "<html>";
print "<head>";
print "<meta http-equiv='Content-Language' content='de'>";
print "<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>";
print "<meta name='GENERATOR' content='PFE 32'>";
print "<title>$title</title>";
print "</head>";
print "<body bgcolor='$bgc' link='$sfl' alink='$sfa' vlink='$sfb'>";
$db = mysql_connect("$MySQL_Host","$MySQL_User","$MySQL_Passw") or die (mysql_error());
mysql_select_db("$MySQL_Data");
$res = mysql_query("SELECT * FROM korb where SessionID='$sid'") or die (mysql_error());
$num = mysql_num_rows($res);
if ($num == 0)
{
print "<font face='$ff' size='2'>Ihr Warenkorb ist leer.</font>";
}
else
{
print "<$ffa>Lieferanschrift<$ffe><br><br>";
print "<table width='50%' border='0'>";
print "<tr><td width='15%'><$ffa>Vorname:<$ffe></td><td width='35%'><input type='text' name='Vorname'></td></tr>";
print "<tr><td width='15%'><$ffa>Nachname:<$ffe></td><td width='35%'><input type='text' name='Nachname'></td></tr>";
print "<tr><td width='15%'><$ffa>Strasse:<$ffe></td><td width='35%'><input type='text' name='Strasse'></td></tr>";
print "<tr><td width='15%'><$ffa>Postleitzahl:<$ffe></td><td width='35%'><input type='text' name='PLZ'></td></tr>";
print "<tr><td width='15%'><$ffa>Ort:<$ffe></td><td width='35%'><input type='text' name='Ort'></td></tr>";
print "<tr><td width='15%'><$ffa>Telefon:<$ffe></td><td width='35%'><input type='text' name='Telefon'></td></tr>";
print "<tr><td width='15%'><$ffa>Fax:<$ffe></td><td width='35%'><input type='text' name='Fax'></td></tr>";
print "<tr><td width='15%'><$ffa>eMail:<$ffe></td><td width='35%'><input type='text' name='eMail'></td></tr>";
print "</table>";
print "<br><$ffa>Ihr Warenkorb:<$ffe><br>";
print "<table width='100%' border='0'>";
print "<tr><td width='10%' bgcolor='#99CCFF'><$ffa>Position<$ffe></td><td width='20%' bgcolor='#99CCFF'><$ffa>Artikelnummer<$ffe></td><td width='40%' bgcolor='#99CCFF'><$ffa>Artikelname<$ffe></td><td width='10%' bgcolor='#99CCFF'><$ffa>Menge<$ffe></td><td width='20%' bgcolor='#99CCFF'><$ffa>Preis<$ffe></td><td bgcolor='#99ccff' colspan='2'> </td></tr>";
for ($i=0; $i<$num; $i++)
{
$sid = mysql_result($res, $i, "SessionID");
$Anr = mysql_result($res, $i, "ArtikelNR");
$An = mysql_result($res, $i, "ArtikelName");
$Me = mysql_result($res, $i, "Menge");
$Pr = mysql_result($res, $i, "Preis");
$lf = $i + 1;
$ges = $Me*$Pr;
print "<tr><td width='10%'><$ffa>$lf<$ffe></td><td width='20%'><$ffa>$Anr<$ffe></td><td width='40%'><$ffa>$An<$ffe></td><td width='10%'><$ffa>$Me<$ffe></td><td width='20%'><$ffa>". number_format($ges,2) ." €<$ffe></td><td><$ffa1>";
print "<form action='anzahl.php' method='POST'>";
print "<input type='hidden' name='F1' value='$sid'>";
print "<input type='hidden' name='F2' value='$Anr'>";
print "<input type='hidden' name='F3' value='$An'>";
print "<input type='Submit' name='anzahl' value='+' style='font-family: $ff; font-size: 8pt'>Menge<$ffe></form></td><td><$ffa1>";
print "<form action='entfernen.php' method='POST'>";
print "<input type='hidden' name='F1' value='$sid'>";
print "<input type='hidden' name='F2' value='$Anr'>";
print "<input type='hidden' name='F3' value='$An'>";
print "<input type='hidden' name='F4' value='$Pr'>";
print "<input type='Submit' name='loeschen' value='-' style='font-family: $ff; font-size: 8pt'>löschen<$ffe></form></td></tr>";
}
print "<tr><td width='10%'> </td><td width='20%'> </td><td width='40%'> </td><td width='10%'><$ffa>Gesamtsumme: <$ffe></td><td width='20%'><u>";
$db1 = mysql_connect("$MySQL_Host", "$MySQL_User", "$MySQL_Passw");
mysql_select_db("$MySQL_Data");
$korbsumme=mysql_query("select sum(Menge*Preis) as gesamt from korb where SessionID='$sid'");
$gesamt=mysql_result($korbsumme,0,"gesamt");
print "<$ffa><b>$gesamt €</b></u><$ffe></td></tr>";
mysql_close($db1);
print "</table>";
print "<br><br>";
print "<table width='30%' border='0'>";
print "<tr><td width='50%'><form action='bestellen.php' method='POST'><input type='submit' name='bestellen' value='bestellen' style='font-family: $ff; font-size: 8pt'><input type='hidden' name='F1' value='$sid'></form></td><td width='50%'><form action='korbleer.php' method='POST'><input type='SUBMIT' name='leeren' value='Warenkorb löschen' style='font-family: $ff; font-size: 8pt'><input type='hidden' name='F1' value='$sid'></form></td></tr>";
print "</table>";
}
mysql_close($db);
print "</body>";
print "</html>";
?>
HTML Ausgabe
<html>
<head>
<meta http-equiv='Content-Language' content='de'>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>
<meta name='GENERATOR' content='PFE 32'>
<title>PHP-Shop Test</title>
</head>
<body bgcolor='#ffffff' link='#000000' alink='#000000' vlink='#000000'>
<font face='Comic Sans MS' size='2'>Lieferanschrift</font><br><br>
<table width='50%' border='0'>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Vorname:</font></td><td width='35%'><input type='text' name='Vorname'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Nachname:</font></td><td width='35%'><input type='text' name='Nachname'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Strasse:</font></td><td width='35%'><input type='text' name='Strasse'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Postleitzahl:</font></td><td width='35%'><input type='text' name='PLZ'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Ort:</font></td><td width='35%'><input type='text' name='Ort'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Telefon:</font></td><td width='35%'><input type='text' name='Telefon'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>Fax:</font></td><td width='35%'><input type='text' name='Fax'></td></tr>
<tr><td width='15%'><font face='Comic Sans MS' size='2'>eMail:</font></td><td width='35%'><input type='text' name='eMail'></td></tr>
</table>
<br><font face='Comic Sans MS' size='2'>Ihr Warenkorb:</font><br>
<table width='100%' border='0'>
<tr><td width='10%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Position</font></td><td width='20%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Artikelnummer</font></td><td width='40%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Artikelname</font></td><td width='10%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Menge</font></td><td width='20%' bgcolor='#99CCFF'><font face='Comic Sans MS' size='2'>Preis</font></td><td bgcolor='#99ccff' colspan='2'> </td></tr>
<tr><td width='10%'><font face='Comic Sans MS' size='2'>1</font></td><td width='20%'><font face='Comic Sans MS' size='2'>00001</font></td><td width='40%'><font face='Comic Sans MS' size='2'>Kaffetasse</font></td><td width='10%'><font face='Comic Sans MS' size='2'>1</font></td><td width='20%'><font face='Comic Sans MS' size='2'>20.50 €</font></td><td><font face='Comic Sans MS' size='1'><form action='anzahl.php' method='POST'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'><input type='hidden' name='F2' value='00001'><input type='hidden' name='F3' value='Kaffetasse'><input type='Submit' name='anzahl' value='+' style='font-family: Comic Sans MS; font-size: 8pt'>Menge</font></form></td><td><font face='Comic Sans MS' size='1'><form action='entfernen.php' method='POST'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'><input type='hidden' name='F2' value='00001'><input type='hidden' name='F3' value='Kaffetasse'><input type='hidden' name='F4' value='20.50'><input type='Submit' name='loeschen' value='-' style='font-family: Comic Sans MS; font-size: 8pt'>löschen</font></form></td></tr>
<tr><td width='10%'> </td><td width='20%'> </td><td width='40%'> </td><td width='10%'><font face='Comic Sans MS' size='2'>Gesamtsumme: </font></td><td width='20%'><u><font face='Comic Sans MS' size='2'><b>20.50 €</b></u></font></td></tr>
</table>
<br><br>
<table width='30%' border='0'>
<tr><td width='50%'><form action='bestellen.php' method='POST'><input type='submit' name='bestellen' value='bestellen' style='font-family: Comic Sans MS; font-size: 8pt'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'></form></td><td width='50%'><form action='korbleer.php' method='POST'><input type='SUBMIT' name='leeren' value='Warenkorb löschen' style='font-family: Comic Sans MS; font-size: 8pt'><input type='hidden' name='F1' value='3a51f34651884f90a844f29d5a1d6583'></form></td></tr>
</table>
</body>
</html>
Wer kann mir hier weiterhelfen?
cu
Gilbert
Kommentar