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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:38:59+00:00 2026-06-15T01:38:59+00:00

All, I have a form that has some text inputs, checkboxes, select box and

  • 0

All,
I have a form that has some text inputs, checkboxes, select box and a textarea. I want to submit the form with PHP using a submit button to a page for processing.

That part is fine but what I would like to do is basically get the results into an array so I can do a foreach loop to process the results.

Basically I’m trying to create a dynamic form the submits to my backend processing script and don’t want to hard code in the post values like the following:

$var1 = $_POST['var1'];
echo $var1;
$var2 = $_POST['var2'];
echo $var2;

Does anyone know how to go about doing something like this or give any recommendations?

  • 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-06-15T01:39:01+00:00Added an answer on June 15, 2026 at 1:39 am

    If there’re no other data in your POST but these generated elements, just do

    foreach( $_POST as $key => $val ) {
        // do your job 
    }
    

    and process what you have. If you want to mix your generated entries with predefined you may want to put these generated in nested array:

    <input ... name="generated[fieldname]" />
    

    and then you iterate

    foreach( $_POST['generated'] as $key => $val ) {
      // do your job
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay all, I have a form that I want users to fill out. When
I have a form with 2 text boxes that all do the same thing.
I have a form[method=get] which has a number of checkboxes all have the same
I'm trying to build a form that will have mixed inputs mostly text and
I have a form with a table that has two input boxes, a select
I want to create a javascript form that basically has a bunch of text
I have a code that I want to auto-submit 5 seconds after Facebook has
I have a form generator that makes all the dbEdits the same width. The
Afternoon All, I have a web form that i wish my user to fill
I have several label boxes on my design form that all share the naming

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.