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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:52:36+00:00 2026-05-28T13:52:36+00:00

I am passing values from a form to a processing page. There are more

  • 0

I am passing values from a form to a processing page. There are more fields but the one in concern is:

<label><input type="checkbox" name="plans[]" value="1" /> Number 1</label>
<label><input type="checkbox" name="plans[]" value="2" /> Number 2</label>
<label><input type="checkbox" name="plans[]" value="3" /> Number 3</label>
<label><input type="checkbox" name="plans[]" value="4" /> Number 4</label>

I know the values are submitting corretly and exist when printing $_POST on the processing page displays the plans array inside my $_POST array.

On my processing page (submitted from form), if an error occurs within the data, the original $_POST values are stored as a new $_SESSION[‘fields’] variable so that they may repopulate the fields when the page redirects to the previous page.

$_SESSION['fields'] = $_POST;

If an error does occur, my actual form page pulls the original field values from the SESSION variable with the following code:

if(isset($_SESSION['fields'])) {
        $fields = array();
        $fields = $_SESSION['fields'];
        unset($_SESSION['fields']);
}

When printing the $fields variable, all original post values appear EXCEPT the original arrays (checkboxes). They do not show up at all (name, address, etc do however).

Are you unable to pass an array within an array by reference in this manner?

edit

The flow is this:

  1. form.php
  2. (all values are sent POST to processing page) processing.php
  3. POST values are validated and if any errors or issues exist, $_SESSION[‘fields’] = $_POST
  4. redirect back to form.php to fix error, highlight issue, and display all original values into fields.
  • 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-28T13:52:37+00:00Added an answer on May 28, 2026 at 1:52 pm

    Make sure that you are not doing any type of data manipulation before you pass it to the SESSION variable such as an array_pop() or in your case the array_map(). The reason why your array_map (strtoupper) is breaking your array, is the strtoupper is trying to be performed on the Array and not the individual elements. To fix this you could check for is_array in your mapping and then loop in there as well or setup a recursive function incase of nested array elements.

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

Sidebar

Related Questions

When i am passing values from the one form(Form1) to other form(Form2) Via constructor
Wierd behaviour when passing values to and from second form. ParameterForm pf = new
i have problem passing data from one page to another using GET, for example
Curently I'm passing my const string values up from my C++ into my C#
I'm trying to glue together two web services by passing a value from one
How can one call a ColdFusion function, passing in attribute values as arguments, inside
I have a form "test.cfm" It passes values to an action page "testAction.cfm"! test.cfm
Man am passing these values from the function to the db model as :
I am passing form values to stored procedure parameters and it appears I may
I have the following form: <form class=lift:form.ajax> <input type=hidden class=lift:StreamIn id=path value=PATH /> <input

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.