Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dynamic form values $_POST / edit shopping cart

Posted on 2004-08-24
1
Medium Priority
?
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
irf2k earned 500 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for …
The viewer will learn how to dynamically set the form action using jQuery.
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 …

610 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