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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:27:48+00:00 2026-05-22T21:27:48+00:00

I have a problem with a php multistep form. I need to perform the

  • 0

I have a problem with a php multistep form.
I need to perform the switching between the different forms only in one page.
In this page I switch the following cases:

 $_SESSION["profilo"]= $_POST["profilo"];
 $_SESSION["periodic"]=$_POST["periodic"];      
 $_SESSION["from"]=$_POST["from"];
 $_SESSION["to"]=$_POST["to"];
 $_SESSION["weekdays"]=$_POST["weekdays"];
 $_SESSION["start"]=$_POST["start"];
 $_SESSION["expire"]=$_POST["expire"];
$step = 1;

if(!isset($_SESSION["profilo"]))
{

    $step = 1;
}
elseif(isset($_SESSION["profilo"]) && !isset($_SESSION["periodic"]))
{

    $step = 2;
}
elseif(isset($_SESSION["periodic"]) && !isset($_SESSION["start"]))
{

    $step = 3;

}
else
{

    $step = 4;
}

then I execute the instruction

WriteForm($step);

which is a function that switches the different forms depending on the value of $step.
The problem is that after the second step, it kicks me back to the first form insted of going step 3. I think the problem is that the second time I hit “Submit”, in my second form i don’t have a “profilo” field: the following execution of my page overwrite $_SESSION[“profilo”] with a NULL value going back to step 1 cause of the if cycle.
How can I solve this problem?

EDIT:
for sake of information: form1 have just “profile” field, form2 have “periodic”, “from”, “to”, “weekdays”, form3 have “start”, “expire”.

  • 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-22T21:27:49+00:00Added an answer on May 22, 2026 at 9:27 pm
     if(isset($_POST["profilo"])) $_SESSION["profilo"]= $_POST["profilo"];
     if(isset($_POST["periodic"])) $_SESSION["periodic"]=$_POST["periodic"];      
     if(isset($_POST["from"])) $_SESSION["from"]=$_POST["from"];
     if(isset($_POST["to"])) $_SESSION["to"]=$_POST["to"];
     if(isset($_POST["weekdays"])) $_SESSION["weekdays"]=$_POST["weekdays"];
     if(isset($_POST["start"])) $_SESSION["start"]=$_POST["start"];
     if(isset($_POST["expire"])) $_SESSION["expire"]=$_POST["expire"];
    $step = 1;
    
    if(!isset($_SESSION["profilo"]))
    {
    
        $step = 1;
    }
    elseif(isset($_SESSION["profilo"]) && !isset($_SESSION["periodic"]))
    {
    
        $step = 2;
    }
    elseif(isset($_SESSION["periodic"]) && !isset($_SESSION["start"]))
    {
    
        $step = 3;
    
    }
    else
    {
    
        $step = 4;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this page: http://www.problemio.com/problems/problem.php?problem_id=214 On it there is a link suggest a solution
I have problem with session in cakephp.I have one file chat.php that is in
i have a problem, i'm working on a gallery php script and need help,
Problem PHP session in different folder. I have problem with PHP session. There are
I have a problem with my php/mysql script. It should only output the while
I have problem here, I need all the stuffs inside this $_SESSION['cart'] thing and
i have a problem with php.ini file. i need to change current date and
I have problem with double links in mydatabase. I have in php file form
i have problem passing data from one page to another using GET, for example
i have problem at php $_POST code. this is the my codes? what i

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.