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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:37:05+00:00 2026-05-23T01:37:05+00:00

I’m working on a multi-page form. Here’s the outline of its function: Part One:

  • 0

I’m working on a multi-page form. Here’s the outline of its function:

Part One: Collect Form Input Fields -> Sends user to transfer.php using POST method

Part Two: transfer.php | Validates that nothing is empty -> Stores $_POST variables into a $_SESSION -> Redirects user to next part of the form.

Part Three: Second Part of Form | Maintains the session from the first form -> Adds new variables to the session -> Preps for everything to get emailed

I’ve been reading how using header( location: ) etc drops session information. The solution people seem to find is to validate the form on page, then direct the user using the action field of the form.


The problem I’m having:
Where the form redirects is based on the input from the form. There are actually 8 potential forms that the user could be forwarded to depending on what they input during the first form.

I’ve tried SID techniques and the
SESSION variables show up as
registered, but they all display
&NULL.

Question: How can I get the session variables to display on the next page?


Here’s the code I have so far:

Part 1: the form

<form method="POST" action="transfer.php">
... all my form elements with proper names
</form>

Part 2: transfer.php

<?php
session_start();
$_SESSION = $_POST;

// project_type would store an url for the corresponding 2nd part of the form
$redirect = $_SESSION['project_type'];
$redirect .= "?phpSESSID=".session_id();
header("Location: $redirect");
exit();
?>

Part 3: the next form

<?php
// initialize a session
session_start();
echo "<p>Session ID: " . session_id() . "</p>";                     
echo "<p>Vardump Set Off Page: ";
var_dump($_SESSION);
echo "</p>";
?>

<form method="...... the rest of the form etc

I know that the post is making it to transfer.php correctly.
I know that the content of $_POST is being copied to $_SESSION correctly.
I know that somewhere during the redirect, the session variables are being set to &NULL

Here’s what the var_dump looks like after the user gets redirected to the 2nd part of the form.

array(18) { ["project_type"]=> &NULL ["project_timeframe"]=> &NULL ["company_name"]=> &NULL ["company_address"]=> &NULL ["company_city"]=> &NULL ["company_state"]=> &NULL ["company_zipcode"]=> &NULL ["company_phone"]=> &NULL ["company_website"]=> &NULL ["contact_name"]=> &NULL ["contact_title"]=> &NULL ["contact_email"]=> &NULL ["contact_phone"]=> &NULL ["contact_primary_phone_type"]=> &NULL ["contact_phone_alt"]=> &NULL ["contact_alternate_phone_type"]=> &NULL ["contact_preferences"]=> &NULL ["contact_preferences_additional"]=> &NULL } 
  • 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-23T01:37:06+00:00Added an answer on May 23, 2026 at 1:37 am

    Just use session_start(); at the top of the page.
    There is no need for the session_id($_GET['phpSESSID']); unless you are changing to a different session.

    EDIT:

    Also in transfer.php you just want all the posts to be saved to the session so just do:

    session_start();
    $_SESSION = $_POST;
    

    ALSO: remove this line: session_write_close();

    • 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'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from

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.