Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6534777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:17:32+00:00 2026-05-25T10:17:32+00:00

I have an online store, and the page mycart.php will display user`s purchases like

  • 0

I have an online store, and the page mycart.php will display user`s purchases like this :

image – title – price per unit – quantity – total price

The product IDs and Quantities are held in $_SESSION arrays. (Is this good ?)

So if the user want 2 pieces of one product and 3 pieces of another product:

  1. How to generate the <input> tag (<input id="product1" name="product-1647">?)
  2. How to iterate through that input if the attribute name="product-1647" is dynamic generated?

I’ve studied a website and they generate inputs like above.

<input type="text" id="product1" name="product-23342">
<inpyt type="text" id="product2" name="product-47385">
...

But i can’t figure it out how the post-processing is done.
Any advice will be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:17:33+00:00Added an answer on May 25, 2026 at 10:17 am

    html

    <input type="text" id="product1" name="product[23342]">
    <inpyt type="text" id="product2" name="product[47385]">
    

    php

    foreach ($_POST['product'] as $prod_id => $prod_value){
      if ($prod_value){
        // do whatever
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an online store. A products page that allows the user to view
I have this page, let's call it index.php index.php has a list of users
In my online store I have a dropdown that lists a number of products.
Does anyone have recommendations on the best Online Store for non-technical users of Joomla?
We have a domain and now we need to setup an online store. Which
I'm working on an online store. I have it setup on my testing server.
I've created an online store within an android app in webview but have one
I'm programming an Android app, where I have to store pictures to some online
I have a online shopping cart, at checkout user enters his zipcode. There are
I have written an application for an online clothing store in Rails 2.3.5. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.