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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:37:30+00:00 2026-06-14T03:37:30+00:00

i have a form in three steps, from step 1 to step two there

  • 0

i have a form in three steps, from step 1 to step two there is a checkbox, i would like to keep the checkbox value in a session and also to show if it’s checked or unchecked even if the user goes to step 3 of the form then comes back to step two,
right now on form submit i have all the $_POST vars in $_SESSION vars but i cant make it work with checkboxes, this is what i got right now:

   <input type="checkbox" value="<?php  echo isset($_POST['afficher_ddn'])? "1":"0";  ?>"
   style="margin-left: 20px;" name="afficher_ddn" id="afficher_ddn" 
<?php echo $_SESSION['afficher_ddn']=="1" ? "checked" : ""; ?> />

but this doesnt work.

  • 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-14T03:37:31+00:00Added an answer on June 14, 2026 at 3:37 am

    try this example separetly

    Make a page test.php as:

        <?php
        session_start();
        ?>
        <form methos='post' method='post' action='test1.php'>
           <input type="checkbox" value="1"
           style="margin-left: 20px;" name="afficher_ddn" id="ddn"
        <?php echo $_SESSION['afficher_ddn']=="1" ? "checked" : ""; ?> /><br>
    Name:<input type='text' name='f1' value='<?php echo $_SESSION['f1'] ?>' ><br>
    Select:<select name='s1'>
    <option value="" <?php echo $_SESSION['s1']=="" ? "selected" : ""; ?>></option>
    <option value="1" <?php echo $_SESSION['s1']=="1" ? "selected" : ""; ?>>1</option>
    <option value="2" <?php echo $_SESSION['s1']=="1" ? "selected" : ""; ?>>2</option>
    </select><br>
    Test:
    <textarea name='tex1'><?php echo $_SESSION['tex1']; ?></textarea>
    
        <input type='submit'  value='submit'>
        </form>
    

    Make a second page test1.php as:

        <?php
        session_start();
        print_r($_POST);
        echo $_SESSION['afficher_ddn']=$_POST['afficher_ddn'];
    echo $_SESSION['f1']=$_POST['f1'];
    echo $_SESSION['s1']=$_POST['s1'];
    echo $_SESSION['tex1']=$_POST['tex1'];
        ?>
        <form methos='post' action='third.php'>
    
        <a href='test.php'>Step1</a>
        </form>
    

    and Check

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

Sidebar

Related Questions

I have a form with three different dropdown menus, it looks like this: <FORM
I have a windows form application. On the form there are three groupboxs. Each
Ok, here's the condensed form. I have three main tables to draw data from:
I have a three step form where each step posts to its own action.
I have three pages and I would like to have the process be in
I have a form which has three inputs when the page loads -- 2
In VB.net 3.5 SP1 I have a Windows Form with three DataGridView controls. One
I have an ASP.NET form with three text inputs, one each for Work Phone,
I have three input text boxes in my form. First one is teacher, second
I have a FormHandler which requires three dependencie-injections: Form, Request and ArticleManager I configured

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.