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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:22:44+00:00 2026-06-02T11:22:44+00:00

I am creating several forms all submitted via POST in PHP and stored in

  • 0

I am creating several forms all submitted via POST in PHP and stored in sessions. However I cannot get the radio button to store a value into the session. I am trying to store the radio button’s value in the session but cannot get it display. Any help would be greatly appreciated.

Below is a sample of the code I am using;

HTML:

<form method="POST" action="testform2.php">
<input type="radio" id="age" name="age" value="yes"/>Yes<br/>
<input type="radio" id="age" name="age" value="no"/>No<br/>
If no, please tell us your date of birth:<br/>
<textarea id="age" name="age" rows="5" cols="40"></textarea><br/><br/>
<input type="submit" value="Next"></br>
</form>

PHP: At the start of the next form (testform2.php)

<?php
session_start();

$age=$_POST['age'];

$_SESSION['age']=$age;

echo $_SESSION['age'];
?>

With this I don’t get anything from the echo despite clicking on the radio button.

  • 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-02T11:22:46+00:00Added an answer on June 2, 2026 at 11:22 am

    Ensure firstly you have started the session on both pages, and any other pages you use as the first line in the page (well after

    You can debug by doing

    print_r($_POST);
    

    this will print everything in POST, then do the same for session. If its not in the post print then there is an issue with your form, if its in the post print but not in the session print then something is going wrong with it being set.

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

Sidebar

Related Questions

I just finished creating several models and a had to separately write all of
Im creating an application, wich will conect to several sql database and get some
I am creating several image dynamically using the following code: function refresh_gallery(galleryidentifier, albumid) {
I'm creating several menu items programmatically like this : NSMenuItem* newItem = [[NSMenuItem alloc]
I'm creating several visual objects in loop: ... Package packet; // a visual packet
using c# (asp.net) i'm programmatically creating several drop down lists (random number). the user
In my program, I am creating several threads in the main() method. The last
I'm creating a gem which has several scripts in the bin directory the utility
I'm creating a WPF application where several ListView selections are made in a row
While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that

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.