Solved

Dynamic form values $_POST / edit shopping cart

Posted on 2004-08-24
1
257 Views
Last Modified: 2013-11-29
Hi,

    I am creating a form that is dynamically generated, depending on items in the user's shopping cart. Is there anyway to do a dynamic
$_POST[$dynamicvalue]. Or is there another solution.

This is for when a user is editing his/her shopping cart before checkout. They are able to remove items and also to change quantities. The thing is that when they wish to remove an item, they click on a remove button next to the item. Now, naturally each item in the cart has an itemcartID. Each remove button is given the name REMOVE$itemcartID. Ex. If your itemcartID was 90 it would say REMOVE90. Now, i would like to check to see which one has been clicked using $_POST, the only thing is that each time the name will change. From REMOVE90 to REMOVE91 if it is another itemcartID. Got any solutions?

0
Comment
Question by:tariq_deca
1 Comment
 

Accepted Solution

by:
irf2k earned 125 total points
ID: 11888415
When you have an input button, the $_POST value is not the name of the input, yet, the x and y value.

eg. $_POST['image_x'] will give you a value
that way you can check each $_POST['REMOVE'.$variable.'_x']
and your code should work
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Contact Forms for Website 6 85
Getting attribute Values using xslt 4 61
E-commerce cart for beginners 7 160
Passing client data from form to server 5 23
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question