Mam problem z koszykiem na zakupy. Mam skrypt, który przetwarza dane:
$id = $row['ID']; $name = $row['NAME']; $price = $row['PRICE']; <div class="product"> <div class="product_left"> <div class="product_name">'.$name.'</div> <div class="product_img"><img src="obrazki_produkty/'.$row['IMG'].'" title="'.$name.'"/></div> </div> <div class="product_right"> <div class="product_about_name">Opis produktu</div> <div class="product_about">'.$row['ABOUT'].'</div> <div class="product_price">Cena:'.$price.' PLN</div> <a href="index.php?id=koszyk&idkoszyka='.$id.'">Kup teraz</a> </div> <div class="autor_product">Wprowadził: '.$row['AUTHOR'].' | dnia: '.$row['DATE'].'</div> </div>';
Ale gdy klikam na 'Kup teraz' przenosi mnie na pustą stronę. Podaję poniżej fragment strony z przetwarzaniem:
function odbierz($txt) { } $id = odbierz($_REQUEST["id"]); $_SESSION["koszyk"]["$id"]["NAME"]=$dane["NAME"]; $_SESSION["koszyk"]["$id"]["PRICE"]=$dane["PRICE"]; if ($sz=="") $_SESSION["koszyk"]["$id"]["ile"]++; else if ($sz>=1) $_SESSION["koszyk"]["$id"]["ile"]=$sz; } echo "<table border=\"1\"> <colgroup> <col /> <col align=\"right\" /> <col align=\"center\" /> <col align=\"right\" /> </colgroup> <tr><th>towar</th><th>cena</th><th>sztuk</th><th>łącznie</th></tr>"; foreach($_SESSION["koszyk"] as $indeks=>$kosz) { echo "<td> <form action=\"index.php?id=koszyk\" 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=\"index.php?id=koszyk\" 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["PRICE"]*$kosz["ile"]; } echo "<tr><td colspan=\"3\" align=\"right\"> w sumie: </td><td>";
Problem jest taki, że ta część odpowiedzialna za przetwarzanie nie wyświetla wyników ani ich nie dodaje i nie przetwarza, więc nie wiem o co chodzi. Możecie mi pomóc??