MyBB Community Forums

Full Version: What's the best way to do this...?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm creating a wizard (I can't release any details about it), which is incorporated in MyBB.

What it is, is it's a multi-step wizard. Within each step, I want to post the data which the user selects into some sort of database, and at the end, give them results that best match what they selected throughout the wizard.

What would be the best way to do this?

Thanks.
IF
ELSEIF
ELSE

Toungue
You're a tad unclear on your specifications.

I assume you're asking for how to do a step-by-step process?

Each page will have forms, no doubt. Those forms have to be sent to the next page, the next page, etc. Though it's easy to just put them in a database the best solution would be sessions (a query is another process; takes more time to run queries than it does to do straight PHP. Assuming you're adding and getting from the database in each step that adds up). Also, keep each page in another page and include that page in each step

The main page:
URL = blah.php?page=1

if there is no previous data
    exit with an error
else
    if page is valid
         include that page
    else
         exit with an error
end if

n+1th page:

if there is post data from nth page
         do some stuff with it
         put it in a session
         display page
else
         exit with an error
end if