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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:53:48+00:00 2026-05-13T18:53:48+00:00

In one form, I ask a user for his name, I use POST and

  • 0

In one form, I ask a user for his name, I use POST and send the user to FormTwo.php and save the $_POST[“name”] to the session.

In the second for I ask for his lastname and do the same and send him to the registerComplete.php page.

I’m trying to echo all the information he wrote, which by my understand should be accesible through the $_SESSION array, right?

What am I doing wrong? 🙂

RegisterFormOne.php:

<?php session_start(); ?>

<html>
    <head>
        <title>Registration Form - 1 of 2</title>
    </head>

    <body>
        <h1>Registration - Part 1 of 2</h1>
        <p>Please fill in all the required information before submitting the information.</p>
        <form action="registerFormTwo.php" method="post">
            <dt>First Name:</dt>
                <dd><input type="text" name="firstName" /></dd><br />

            <dt>Last Name:</dt>
                <dd><input type="text" name="lastName" /></dd><br />

            <dt>Age:</dt>
                <dd><input type="text" name="age" /></dd><br />

            <dt>Date of Birth:</dt>
                <dd><input type="text" name="dateOfBirth" /></dd><br />

            <dt>Gender:</dt>
                <dd>Masculino <input type="radio" value="M" name="gender" checked/> &nbsp;&nbsp;
                Femenino <input type="radio" value="F" name="gender" />
                </dd>
            <dt><input type="submit" /></dt>
        </form>
    </body>
</html>

RegisterFormTwo.php

<?php
if ($_POST){
  $_SESSION["firstName"] = $_POST["firstName"];
  $_SESSION["lastName"] = $_POST["lastName"];
  $_SESSION["age"] = $_POST["age"];
  $_SESSION["dateOfBirth"] = $_POST["dateOfBirth"];
  $_SESSION["gender"] = $_POST["gender"];
}
?>
<html>
    <head>
        <title>Registration Form - 2 of 2</title>
    </head>

    <body>
        <h1>Registration - Part 2 of 2</h1>
        <p>Please fill in all the required information before submitting the information.</p>               

        <form action="registerFinish.php" method="post">
            <dt>Nationality:</dt>
                <dd><input type="text" name="nationality" /></dd><br />

            <dt>Profession:</dt>
                <dd>
                    <select name="profession">
                        <option value="sistemas" selected="selected">Ing. Sistemas</option>
                        <option value="electrico">Ing. Electrico</option>
                        <option value="marketing">Marketing y Publicidad</option>
                        <option value="comercio">Comercio</option>
                    </select>
                </dd><br />

            <input type="submit" />
        </form>
    </body>
</html>

registerFinish.php

<?php
if ($_POST){
  $_SESSION["nationality"] = $_POST["nationality"];
  $_SESSION["profession"] = $_POST["profession"];
}
?>
<html>
    <head>
        <title>Registration Complete</title>
    </head>

    <body>
        <h1>Thank you for taking the census.</h1>
        <p>Please take a moment to review your inputted information and confirm when you feel everthing is OK.</p>               

        <ul>
            <li><?php /*This should echo his first name, but nothing shows. */ echo $_SESSION["firstName"]; ?></li>

        </ul>

    </body>
</html>
  • 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-13T18:53:49+00:00Added an answer on May 13, 2026 at 6:53 pm

    You miss session_start(); at the beginning of other 2 files.

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

Sidebar

Related Questions

I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to
I have this field in one form : <input type=text name=promocode id=promoCode value= style=width:24%
I am creating one form in html using table. Which have one Drop down
I have one form with several text fields and one button. When i enter
There is one form, inside the form there are many checkboxes. Two operations can
i have one form which have some input box and some select box. i
I have five buttons on one form that when clicked enables a bool each
I am trying to take one form type and display it however times i
so here's the problem I have one form, it outputs search results after submit,
I'm trying to show one form vs. the other depending on the if statement.

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.