mam problem - jest sobie skrypt:
function odbierz($txt) { } $id = odbierz($_REQUEST["id"]); if ($id<>"") { } $_SESSION["koszyk"]["$id"]["towar"]=$dane["nazwa"]; $_SESSION["koszyk"]["$id"]["cena"]=$dane["cena_detaliczna"]; if ($sz=="") $_SESSION["koszyk"]["$id"]["ile"]++; else if ($sz>=1) $_SESSION["koszyk"]["$id"]["ile"]=$sz; } } echo "<table border=0> <colgroup> <col /> <col align=\"right\" /> <col align=\"center\" /> <col align=\"center\" /> <col align=\"right\" /> </colgroup> <tr><th bgcolor=#9999ff>towar</th><th bgcolor=#9999ff>cena</th><th bgcolor=#9999ff>sztuk</th><th bgcolor=#9999ff>łącznie</th></tr>"; foreach($_SESSION["koszyk"] as $indeks=>$kosz) { echo "<td> <form action=koszyk.php method=get style=display:inline;> <div style=\"display:inline;\"> <input type=hidden name=id value=$indeks> <input type=text name=sz value=\"{$kosz["ile"]}\" style=\"width:25px;\" > <input type=submit value=zmień style=\"width:45px;\" > </div></form> <form action=koszyk.php method=get style=\"display:inline;\"> <div style=\"display:inline;\"> <input type=hidden name=id value=$indeks /> <input type=hidden name=sz value=0 style=\"width:25px;\" /> <input type=submit value=usuń style=\"width:45px;\" /> </div></form> </td>"; $lacznie +=$kosz["cena"]*$kosz["ile"]; } echo "<tr><td colspan=\"3\" align=\"right\"> <b>w sumie: </td><td align=right><b>";
i do niego dodałam:
function odbierz($txt) { } $id = odbierz($_REQUEST["id"]); if ($id<>"") { } $_SESSION["koszyk"]["$id"]["towar"]=$dane["nazwa"]; $_SESSION["koszyk"]["$id"]["cena"]=$dane["cena_detaliczna"]; $_SESSION["koszyk"]["$id"]["gabaryty"]=$dane["gabaryty"]; if ($sz=="") $_SESSION["koszyk"]["$id"]["ile"]++; else if ($sz>=1) $_SESSION["koszyk"]["$id"]["ile"]=$sz; } } echo "<table border=0> <colgroup> <col /> <col align=\"right\" /> <col align=\"center\" /> <col align=\"center\" /> <col align=\"right\" /> </colgroup> <tr><th bgcolor=#9999ff>towar</th><th bgcolor=#9999ff>gabaryt</th><th bgcolor=#9999ff>cena</th><th bgcolor=#9999ff>sztuk</th><th bgcolor=#9999ff>łącznie</th></tr>"; foreach($_SESSION["koszyk"] as $indeks=>$kosz) { echo "<td> <form action=koszyk.php method=get style=display:inline;> <div style=\"display:inline;\"> <input type=hidden name=id value=$indeks> <input type=text name=sz value=\"{$kosz["ile"]}\" style=\"width:25px;\" > <input type=submit value=zmień style=\"width:45px;\" > </div></form> <form action=koszyk.php method=get style=\"display:inline;\"> <div style=\"display:inline;\"> <input type=hidden name=id value=$indeks /> <input type=hidden name=sz value=0 style=\"width:25px;\" /> <input type=submit value=usuń style=\"width:45px;\" /> </div></form> </td>"; $lacznie +=$kosz["cena"]*$kosz["ile"]; } echo "<tr><td colspan=\"3\" align=\"right\"> <b>w sumie: </td><td align=right><b>"; echo "</table>
czyli zmienna gabaryty. Niestety zmienna gabaryty nie chce się wyświetlać.
Gdzie robie błąd?