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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:20:21+00:00 2026-05-12T15:20:21+00:00

This question is likely to be somewhat longer than SO’s average questions, so I’ll

  • 0

This question is likely to be somewhat longer than SO’s average questions, so I’ll try to keep it as short as possible:

I’m designing a dynamic form that users need to fill in and submit. This form is massive, with over 500 possible questions. The questions displayed to the user depend on answers given in previous answers (for example; only if the user checks the ‘still in school’ checkbox, the school-related questions page will show.)

This form has quite a few requirements:

  • Multiple pages, which can be ‘turned on or off’ depending on the answers given.
  • When a user goes back and changes a particular answer, filled groups that will be turned off need to have their questions’ answers emptied.
  • Some questions are pre-filled according to earlier answers given.
  • Forms will need to be saved to the database on every new page request, so users can pause and continue filling the form at will.

The best approach to this would seem to be an OO one; define a class that accepts multiple options (title, type of input to be used, possible answers, etc), and builds the HTML accordingly.

The main problem with this approach, however, is that because questions can ‘borrow’ information from prior ones, it won’t suffice to create an instance for just the questions to be displayed on the page. In fact, the only reliable way is to instance every possible question, everytime the user loads a new page.

This approach is likely to kill PHP performance; and to me, it seems like this is not the proper OO solution.

Are there better solutions to this problem?

In essence, I need a fast and lightweight way to create multi-dimensional array of 500 to 1000 records (class instances?), roughly 10 of which will be displayed on a page at any given time.

Preferably, I want to store the form as an XML document, so any approach that would work well in this aspect would be preferred.

  • 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-12T15:20:21+00:00Added an answer on May 12, 2026 at 3:20 pm

    I’m going to describe a solution using a database as the storage mechanism, you can use whatever works, but this will be easier to describe.

    Start I’d build a table that holds all of the “Pages” of the survey. This would just be used to group questions, and to define any requirements for display

    Second build a table to store every question in your form. This table should hold the base information about what the question is, it’s type, answers (if predefined), etc. As well as any information specifying where predefined data might come from if it’s dynamic.

    Third build a table/tables to hold your users data.

    Now that you have all of your data taken care of build a single web page that will load all users data for the form. Use the users data + session data to determine what “Page” from your database needs to be displayed. Using that information pull all questions for the “Page” being displayed and build them into an HTML form for display to the user. Your form should submit back to itself, could have multiple buttons to control Previous, Next functionality. If when your page loads it’s been submitted you’ll need to store any values POSTED before pulling your user data back out.

    That is how I’d solve this problem working from scratch. You can break many of these pieces up into various objects to help encapsulate your data and functionality. But your question to me sounds like you were lost as to where to start so hopefully this will help you solidify things.

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

Sidebar

Related Questions

I realize that the answer to this question is likely quite obvious (if somewhat
(This question is over 6 years old and probably no longer has any relevance.)
I think this is likely to be a generic .NET assembly loading question, but
This question is kind of an add-on to this question In C#, a switch
This question and answer shows how to send a file as a byte array
This question comes on the heels of the question asked here . The email
This question would probably apply equally as well to other languages with C-like multi-line
This question is a follow up to my previous question about getting the HTML
This question is about removing sequences from an array, not duplicates in the strict
This question is the other side of the question asking, How do I calculate

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.