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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:36:53+00:00 2026-06-11T17:36:53+00:00

page 1 $formData = array(); $formData[0] = ‘insert data done’; $_SESSION[‘form_data’] = $formData; header(‘Location:

  • 0

page 1

$formData = array();
$formData[0] = 'insert data done';
$_SESSION['form_data'] = $formData;
header('Location: view.php');

Page 2

if (isset($_SESSION['form_data'][0])) {
echo $_SESSION['form_data'][0];
unset($_SESSION['form_data']);
}

In the page 1 code, i comment out the header and put a

var_dump($_SESSION['form_data'][0]);

as what i was hope

"string(16) "insert data done"" 

this is correct but in the page 2 I put a

var_dump($_SESSION['form_data'][0]);

the output was

string(1) “i”

what I did wrong. in the page 2 i just want to echo the value and unset it but i tried to use

var_dump($_SESSION['form_data']);

the output was right

maybe my unsettling method might wrong.

  • 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-11T17:36:54+00:00Added an answer on June 11, 2026 at 5:36 pm

    Have you tried echo $_SESSION['form_data'] ? it seems that you’re getting the first letter of the string.

    I think that if only one pair of key => value is set on a $_SESSION variable, it automatically reduces to its value. But i can’t find any reference online.

    Try to use this code on page 1:

    $formData['someKey'] = 'insert data done';
    

    and this on page 2:

    echo $_SESSION['form_data']['someKey'];
    

    let’s see what happens…

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

Sidebar

Related Questions

Here is my code, //I have set formData array to session array here $_SESSION['form_data']
If you use POST to send FORM data to a PHP page, are the
I`m trying to send simple html page with form data to user with GET,
While trying to validate form data on my page i get the following error:
i have a submit page in html . when i submit the form data,
Say if I am on page 1 , I enter my form data and
I have a simple table for reference page: id name description image In reference.php,
I am using PHP filter to perfom basic sanitization and validation of form data.
I'm getting a PHP Notice if I set a $_SESSION index without submission. Wanted
I have an HTML form, being submitted to a PHP page. The PHP page

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.