Re: Dynamic Form List - how to change values
| From: | Jochem Maas | Date: | Fri, 10 Mar 2006 14:26:02 +0000 |
| Subject: | Re: Dynamic Form List - how to change values | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231767@lists.php.net to get a copy of this message | ||
tedd wrote:
if your running Apache the default max length of the url is 8K - this can be upped but you have to recompile Apache. the HTTP spec itself doesn't stipulate a limit to the length... in general though anything over 512 bytes (outside of CMS tools) is discouraged...Pat: You can add numerous items to the url. I don't remember the total number of characters that's allowed, but it's considerable.Pat: I would suggest changing to: http://.../chkout.php?imagename=NATURE-1.jpg&count=6&continue=Continue+Checkout, $newqty = $_GET['count']; $imagename = $_GET['imagename']; Also, to see what you are actually "getting" try: echo ("<br/>"); echo ("<pre>"); echo ("GET info:\n"); print_r($_GET); echo("</pre>"); You might also want to consider taking care of undefined variables -- here's a reference: http://www.weberdev.com/get_example-3823.html HTH's teddOk, this works for one item, but my shopping cart may have (hopefully) dozens of items in it. How do I refer to each new quantity changes for each new row in the table? I was hoping that by making the qty field a name of the image, I would be able to match the new qty up with the right image quickly, but that won't work, obviously. How can I change multiple items in a list (or all) when the list is dynamically created? My approach may be wrong -- suggestions?
If you reach the limit, but might consider reducing the number of characters in your variables, such as: "NATURE-1.jpg" could be n1 where you had a look-up table or you knew what the cryptic code was to make the transformation. Or you could continue on a course like you were with n1=6 where you know that n1 stands for "NATURE-1.jpg" and the value contained therein is the value for that image. There's lot's of ways to do this. As for it being dynamically created, that shouldn't present a problem either -- just treat the url as a string and add ampersands (&) between "variables and their value" pairs. HTH's tedd