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

  • Home
  • SEARCH
  • 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 6595997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:00:50+00:00 2026-05-25T18:00:50+00:00

Currently I’m working on a textbook ordering html form with PHP User shown a

  • 0

Currently I’m working on a textbook ordering html form with PHP

User shown a list of textbook and theres a Quantity dropdown menu for each textbook (they can select to order 1 quantity or 2,3 or 4)

Each textbook have a unqiue textbookId number.

How can I create a html form which can determine which textbook they order and the quantity they order?

I usually solve this kind of problem by creating multiple html form (each form contain hidden field of textbookId) but the problem is that’s there will be multiple submit button.

But I only one submit button for the whole textbook list.

Can someone please help me 🙂 thanks so much in advance

If possible can you show me how to process the data in php as well.

Cheers

Here is my current html form code:

<div class="tables">
    <form action="process-order" id="login-form" method="get" name="login-form"></form>
    <table class="orders">
      <tr>
        <th>textbookId</th>
        <th>Subject</th>
        <th>Title</th>
        <th>Price</th>
        <th>Quantity</th>
      </tr>
      <tr>
        <td>1</td>
        <td>English</td>
        <td>English ABC</td>
        <td>33.00</td>
        <td>
          <div align="center">
            <select name="mydropdown">
              <option value="0">0</option>
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
            </select>
          </div>
        </td>
      </tr>
      <tr>
        <td>2</td>
        <td>Math</td>
        <td>Math SignPost</td>
        <td>122.00</td>
        <td>
          <div align="center">
            <select name="mydropdown">
              <option value="0">0</option>
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
            </select>
          </div>
        </td>
      </tr>
    </table>
    <input type="submit" name="submit" id="submit" value="Next">
    </form>
</div>
  • 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-25T18:00:51+00:00Added an answer on May 25, 2026 at 6:00 pm

    One possibility is to encode the book ID into the submitted form element e.g. <select name="book_1">
    for the book 1.

    <tr>
        <td>1</td>
        <td>English</td>
        <td>
        <div align="center">
        <select name="book_1">
        <option value="0">0</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        </select>
        </div>
        </td>
    </tr>
    <tr>
        <td>2</td>
        <td>Math</td>
        <td>
        <div align="center">
        <select name="book_2">
        <option value="0">0</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        </select>
        </div>
        </td>
    </tr>
    

    PHP processes the books as follows:

    <?php
    $books = array();
    if ($_GET) {
        foreach ($_GET as $key => $value) {
            $keys = split("_", $key);
            if (count($keys) == 2 && $keys[0] == "book") {
                $id = $keys[1];
                $books[$id] = $value;
            }
        }
    }
    // echo "Ordered: <br />";
    // foreach ($books as $id => $value) {
    //    echo "$id : $value <br />";
    // }
    ?> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently after my form has passed validation it forwards to an html page. I
Currently I'm developing a registration form for new user in Android (native app.) and
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently I know of only two ways to cache data (I use PHP but
Currently I using the following code to get my JSON output from MySQL. <?php
Currently working on a Spring 2.5 web application, looks as if the business has
Currently I'm trying to parse some html and return an array with the values
Currently createPopup() is only supported in IE (See http://help.dottoro.com/ljsxcrhv.php ). Is there a universal
Currently, if I go to my site... example.com OR example.com/index.php ...I am redirected to...
Currently I use: RewriteRule ^([^/\.]+)/?$ page.php?page=$1 [L] Which is good for when passing one

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.