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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:44:11+00:00 2026-05-30T12:44:11+00:00

I’ve found myself with the following problem: I have form with a random number

  • 0

I’ve found myself with the following problem: I have form with a random number of fields. (This is so users can enter their fellow team members’s names — and there’s no set size for teams.) I need this inputted data to be formatted in preparation for being stored in a database.

The database structure is fine, it’s just getting a random number of $_POSTs and putting them into an array that’s the issue.

So far I’ve got some javascript that allows the user to create/remove an infinite number of fields, with incrementing ids/names (e.g. TeamMemberName1, TeamMemberEmail1, TeamMemberName2, TeamMemberEmail2, etc.).

Right now I’ve created an ugly series of PHP statements that puts a reasonable amount of POSTed data into a multidimenional array — I don’t see why a team should ever be bigger than 50 — and then I was going to process the array to remove any blank rows before passing it onto the database.

Example:

    $submittedTeamMembers = 
      array ( "teamMember1" => 
          array ( "name" => $_POST["teamMemberName1"],
                  "email" => $_POST["teamMemberEmail1"])
             );

But I’m guessing there’s a better way!

  • 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-30T12:44:13+00:00Added an answer on May 30, 2026 at 12:44 pm

    Your input names can be in array form, which PHP will understand perfectly. Example:

    <input type="text" name="teamMembers[0]['name']" />
    <input type="text" name="teamMembers[0]['email']" />
    

    which PHP will interpret after post as you’d expect:

    //print_r($_POST['teamMembers']);
    Array
    (
        [0] => Array
            (
                [name] => foo
                [email] => bar
            )
    
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have this code to decode numeric html entities to the UTF8 equivalent character.
Does anyone know how can I replace this 2 symbol below from the string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have some data like this: 1 2 3 4 5 9 2 6

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.