I have a Mals shopping cart that has worked well when using the link in the url to get back to the page you came from and with the products selected.
To select a product line to buy, the customer selects from the side menu.
This creates a URL with a link to the server with the product details to be found in the database and served to the page where it is formatted into a table of products. To buy a product you click on the buy link and the details are added to the end of the url link. No problem here.
But if I change to use a form method, still using the GET because the client wanted to add a quantity box to the page, then the link back from Mal’s doesn’t work as it should, it goes back to the page, but it doesn’t pick up the products that was originally selected like it did with just a plain hyperlink.
Here are 2 pages that show what I mean, both use the same Mals shopping cart, so return the same details…(or you can go to either and select the other menu, it’ll go to that page. Not all the links are set yet so if it returns a page with no products when using the menu, it is not an error, just that I haven’t updated all the links. (also there are quite a few pages missing, want to sort this before continuing).
First- Brass Adaptors, second menu down on left, this is the form version, the quantity works but the link back doesn’t.
Second - Hydraulic Compression Fittings, Last menu in the Red Hydraulic Range menu, the link back works as it should, but the quantity doesn’t.
I think it could be something to do with the encoding of the links, the hyperlink sends the correct “&” character that differentiates the separate parts whereas the form encodes the “&” which is not decoded until after it gets back to the page, so the first parameter (item) gets all the link data which means the data is incorrect and the page is served blank with the all the link in the showing.
I’m using the $_GET to retrieve the data from the url:
$item = mysql_real_escape_string(trim($_GET['item'])); $inthere = mysql_real_escape_string(trim($_GET['inthere'])); $line = mysql_real_escape_string(trim($_GET['line']));
this is then passed to the mysql server to retrieve the products from the database.
All works well with a Hyperlink, but It’s the addition of the Quantity box and the form that is causing the problem.
The return link is set in a php $string which is dynamically updated depending on what product range was selected originally.
dynamo mailing list
Update your subscriptions at: