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
Solved

Dynamic form values $_POST / edit shopping cart

Posted on 2004-08-24
1
256 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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
WordPress, WooCommerce, to Authenticate an online service? 2 110
WCAG audit tools 1 90
Re-position the objects 7 116
Fulfillment API php code sample 1 56
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Learn about the eCommerce marketing trends for the year ahead.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

791 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