Hello,
I am trying to figure out the best way to achieve a step-by-step wizard for the creation of a website. I would like for someone that does not know anything about creating websites to be able to go through this wizard and create a website, then at the end the HTML is put together and saved into a database table and then uploaded to an FTP server to put the site live (if possible).

I am not sure how I should go about implementing it, such as the passing around of the information used during the wizard and passing around the selections made so that a script can use them. I thought about storing all information in an array in a class and then passing around a single object of that class in a $_SESSION variable. I have tested this and it works, but I am not sure if it is a good way to do it.

I also thought of maybe making an array and constantly putting it into a database table and then pulling the array on the other pages. I was thinking this would be slow and an unnecessary amount of queries to the database though.

So I am generally just looking to get some ideas and hopefully find a good way to go about this.

Thank you,
Key

Recommended Answers

All 9 Replies

hi "kroche"
first hope ya good luck at your project.

now if i got wat u asking about .. i think u care about the perfect way (coding) to do
such that.

let me say that any way let ya reach your goal is somehow go so never care about wat way
u take.

now let say first wat about saving all ur needed configuration before u start the wizard

as we do for example config's files?

may be if u intrest in gathering information durin the process then u can assign it to file also and save it and append to it when needed

also u may try the

include()

since it give ya the code as it was part of your script
i used it once when i was many scripts system and need to pass all variables
to all scipts ,:D for example u can define ur variable is vars.php and use them
after processin them in all scripts via includin them

good luck and sorry for this long reply

we all learn we all share same information if u have somethin better i will be happy
to hear about

hi "kroche"
first hope ya good luck at your project.

now if i got wat u asking about .. i think u care about the perfect way (coding) to do
such that.

let me say that any way let ya reach your goal is somehow go so never care about wat way
u take.

now let say first wat about saving all ur needed configuration before u start the wizard

as we do for example config's files?

may be if u intrest in gathering information durin the process then u can assign it to file also and save it and append to it when needed

also u may try the

include()

since it give ya the code as it was part of your script
i used it once when i was many scripts system and need to pass all variables
to all scipts ,:D for example u can define ur variable is vars.php and use them
after processin them in all scripts via includin them

good luck and sorry for this long reply

we all learn we all share same information if u have somethin better i will be happy
to hear about

First off - thank you for replying.

I could include a file with all the variables I need, but the problem with that is - all the information is based on user input. So it is not information that I have already.

For example:
Step 1: Select a template, then the selection is saved some where
Step 2: Select the business that the site is for (We have a database of our clients) Then save this selection somewhere
Step 3: Make selections for the template options such as the pages and the navigation and save it somewhere.

Then in the end it would have to all be put together, and the final files saved.
So I don't see how including a file of variables could help - unless you can be more specific.

hi again
i dont see any problem to write your data through the wizard and then get it all at
the end.. but wat ever it is not a problem.

when i said use

include()

i didnt mentioned that would be the optimal solution .. u asked for idea and i tried to help.

and also i think that the costumer choose is not secret just append them on $_GET for example
for choosing template as $tempID u send url save.php?tempID=319 (as an example)
in the next process save resend $tempID tith the new $btype -> save.php?tempID=319&btype=12
etc.. and go on
good luck

hi again
i dont see any problem to write your data through the wizard and then get it all at
the end.. but wat ever it is not a problem.

when i said use

include()

i didnt mentioned that would be the optimal solution .. u asked for idea and i tried to help.

and also i think that the costumer choose is not secret just append them on $_GET for example
for choosing template as $tempID u send url save.php?tempID=319 (as an example)
in the next process save resend $tempID tith the new $btype -> save.php?tempID=319&btype=12
etc.. and go on
good luck

Yes that could work, and that may be the way I do it.

dont forget to mark this thread as solve and rate ma posts :D

I also thought of maybe making an array and constantly putting it into a database table and then pulling the array on the other pages. I was thinking this would be slow and an unnecessary amount of queries to the database though.

If your wizard is on the same server as the database then it wouldn't be slow. The slowest part is most likely the user, choosing his settings. Anyway, if you store it in the database then you have the advantage of a backup of the already selected settings (in case of an accidental browser close). Of course a file solution will have that too, but a session or get parameter solution does not.

i dont think store the data in database is optimal since as i may know he dont care about
the costumer who dont complete the wizard .. but after the process finish he can save it any where in database or file etc.. but his question as i understand was about the data while the process is in the being executed not finished

Member Avatar for diafol

There are loads of different ways to create a wizard. Have you thought about an Ajax approach, using jQuery?

This plugin rocks: http://www.wbotelhos.com/stepy/

@pritaeas: The database is on the same server as the code being run - so it might not be that slow.
@ardav: I will look into that - I would love to be able to use AJAX. It would also be good to go that way because the site this wizard would eventually be integrated into already uses jQuery for AJAX requests.

What I have done in the meantime was created a class that handles all the information for the wizard and stores it into an array in the class itself. This way I could do it all on one page, or pass a serialized object around from step to step if it is on multiple pages.

I also made a backup function that the user can call whenever they want to save a serialized version of the class's array in a database table I created.

Thank you for all the suggestions!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.