Solved

Dynamic form values $_POST / edit shopping cart

Posted on 2004-08-24
1
253 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now