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 6810659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:13:57+00:00 2026-05-26T20:13:57+00:00

Working on making an inventory page for work. I have written a page that

  • 0

Working on making an inventory page for work. I have written a page that will loop through my data base and display all of the items in there.

include 'auth.php'; //to change login, please authenticate 
$sql="SELECT * FROM `inventory` ORDER BY `id` asc;";
$result=mysql_query($sql);
while($rows = mysql_fetch_array($result)){
echo    $rows["name"];
<input type="text" name="<? echo $rows["id"];  ?>" id="<? echo $rows["id"] ?>" placeholder="Who will go in here?" />
}

The above code is doing what I want. I would like to put this in a form and have a submit button. Let’s say the form is

<form method="POST" action="page.php">

Now I want to be able to write a page.php so that it can handle all of the data regardless of the number of items. In the past I have done the following

$fname=$_POST['fname'];
$lname=$_POST['lname'];
$phone=$_POST['phonenum'];
$email = $_POST['email'];
$age = $_POST['b18'];

But that won’t work as I will have an unknown amount of post. Please write any code you like. I prefer document pages.

  • 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-26T20:13:58+00:00Added an answer on May 26, 2026 at 8:13 pm

    $_POST is just an ordinary hash array, so you can loop over it

    foreach ($_POST as $key => $value) {
      print "{$key}: {$value}<br />";
    }
    

    edit
    well you need to do some special adjustments, if your values are array values (POST key with [] at the end of the name)


    edit
    it’s of no use if you try

    foreach ($_POST as $varname => $value) {
      ${$varname} = $value;
    }
    

    because you don’t know the name of the variables;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a web page where I'm making an AJAX call that returns
I am working on making a paged app that will load a separate HTML
I am working on making all of our JS code pass through jslint, sometimes
I am working on making an application that will store information, and for user
working on making a flash program that loads about 1000 jpegs and then plays
I'm working on making this web page: http://jsfiddle.net/pW8yj/ and I want to get a
I'm working on making a website/web application that displays images every 5 or so
So basically I'm working on creating a inventory/sales system. I'm using Core Data, and
I have been working on making my website mobile compatible. Whilst I have successfully
I have been working on making our CMS export valid content for mobile devices.

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.