?
Solved

Dynamic form values $_POST / edit shopping cart

Posted on 2004-08-24
1
Medium Priority
?
260 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

770 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