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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:27:29+00:00 2026-06-18T12:27:29+00:00

I need to be able to store the $_POST data from a form (I’m

  • 0

I need to be able to store the $_POST data from a form (I’m doing that with the SESSION variable) and I need to add data to the $_POST array without overwriting the previous data.

Here’s my original thread about the SESSION variables: Store Array Variables Through Page Refresh with PHP

Here’s an example of what I need to do:

There’s a form on a page that you can put the width and height of a wall to calculate out how much paint/labor would be needed to paint the walls. Once the first wall dimensions are entered, the user can click the submit button labeled “Add Wall” to add another wall to their order.

After the first wall input, the POST data would return something like this:

Array ( [wallW] => Array ( [0] => 9 ) [wallL] => Array ( [0] => 10 ) ) 

After the second wall is entered it would look something like this:

Array ( [wallW] => Array ( [0] => 9 [1] => 20 ) [wallL] => Array ( [0] => 10 [1] => 15 ) ) 

This would continue on until the user has entered all of their walls.

I’ve tried doing array_merge, array_append, etc, but none of those seem to be working; it keeps overwriting what’s tin the POST data, even if I bring the POST data into another array.

I know the easy thing would be to throw some jQuery in there, but this is for a PHP class (and we’re not allowed to use SQL yet) so I’d like to try to figure this out with just PHP.

Any help would be awesome.

Thanks,

Chelsea

  • 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-18T12:27:30+00:00Added an answer on June 18, 2026 at 12:27 pm

    I don’t know why this has been downvoted, i find it rude as you are obviously new to php. But you just need to re-post your post vars in subsequent requests. So you would need to serialize you existing post objects as perhaps hidden fields. What you are missing is that php / http is stateless. So nothing is preserved between requests, another easy solution may be to move these POST variables to SESSION variables.

    I see you’ve added the POST data to the session, but there is no reason to add it back to post, just keep appending to session and then use it from there. adding things to _POST wont force them to be posted next time if thats you are trying todo, see the part about serializing them to hidden fields.

    Good luck, welcome to programming for the web.

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

Sidebar

Related Questions

I need to be able to store the password submitted in a session, as
Users of the website need to able to store images in their area ,
I need to be able to store the current height and width of a
I am currently writing a Employee store and I need to be able to
I am trying to send data(a username and password) to an online form from
I'm designing a database for internal use at my company that will store data
Need to be able to pull Magento products into an external template. Need to
I need to be able to access a list throughout my Rails project. For
I need to be able to search through multiple 2D arrays and search the
I need to be able to create an id for a hyperlink. I have

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.