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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:47:32+00:00 2026-05-23T10:47:32+00:00

I’m creating a form wizard that requires the user to step through and complete

  • 0

I’m creating a form wizard that requires the user to step through and complete each step before moving on to the next.

Right now, once a step is validated and completed, I switch $_SESSION['step'] to the next step in line, and check that variable when the next step loads to make sure it is valid. If a user tries to skip to a step that is out of sequence, the $_SESSION['step'] prevents the step from loading.

Is this the proper approach? Also, once a step is completed, I want the user to be able to go back and edit the values that were entered on any given previous step. My approach doesn’t allow for this, as I’m not sure how I’d set change the session to the step they are revisiting without knowing if it is a valid request or not.

Any input on this would be much appreciated!

  • 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-23T10:47:32+00:00Added an answer on May 23, 2026 at 10:47 am

    There’s nothing wrong with this approach, although you might be a bit limited in that this doesn’t work for more than one form only. However, if this is just one small app, then no worries.

    The second question I’m not sure I understand, but $_SESSION can accept any data type, including arrays, so just fill a $_SESSION with where you are and what you’ve done in the form so far ;

    $_SESSION['my_form'] = array (
       'current_step' = 'step_2',
       'step_1' = array ( // the form elements ),
       'step_2' = array ( // the form elements ),
       'step_3' = array ( // the form elements ),
       'step_4' = array ( // the form elements ),
    ) ;
    

    Next, you provide validation at each point as normal. You can also put a little flag into each form whether they have been filled out or not ;

       'step_2' = array (
          'complete' = true,
          // form elements / fields here
       ),
    

    Another way to slice this is to use one of the many thousands of dynamic forms. For example, using JQuery, you can use the Accordion plugin (from JQuery UI) to simulate the whole thing in just one HTML page.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
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
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
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
I need a function that will clean a strings' special characters. I do NOT

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.