Deleter
-
Posts
2 -
Joined
-
Last visited
Posts posted by Deleter
-
-
Hi there! I encountered a problem within the view_cart.php script that has to do with the only input field - Quantity. When there's already something in the cart, the quantity can't be changed manually and after I press the Update My Cart button nothing changes and the already preset qty is again displayed.
Here is the part of the script that in my opinion is problematic:
61 // Print the returned records 62 echo "\t<tr> 63 <td align=\"left\">{$row['artist']}</td> 64 <td align=\"left\">{$row['print_name']}</td> 65 <td align=\"right\">\${$_SESSION['cart'][$row['print_id']]['price']}</td> 66 <td align=\"center\"><input type=\"text\" size=\"3\" name=\"qty[{$row['print_id']}]\" value=\"{$_SESSION['cart'][$row['print_id']]['quantity']}\" /></td> 67 <td align\"right\">$" . number_format($subtotal, 2) . "</td> 68 </tr>\n";
My guess is that because the value argument is preset with the quantity coming from the session (line 66 of the script), nothing else can be entered into the qty field.
Has anybody encountered the same issue? What would the work around be?
Thank you for taking the time!
Need Help With Script 11.1
in PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
Posted · Edited by Deleter
Typos
Hello everyone!
I recreated the script from chapter 11 about file compression exactly as it is in the book but it only backs up the first table from any database. Here's the code as it is in my IDE:
I tried to print out the $table array and it contains only one element which is baffling since the given database has multiple tables.
The query runs fine, so it can't be the cause of the problem. I'm really out of clues here as to what is going wrong.
Any suggestions would be much appreciated! Thank you!