Forum Moderators: coopster

Message Too Old, No Replies

multistep user registraion

what's the best method to accomplish it?

         

phph

5:27 am on Feb 21, 2006 (gmt 0)

10+ Year Member



Hi everyone,

I need help creating a multistep registration in php & mysql environment. I have done the forms for the separate steps (5 in total, last one being profile activation form, but I have trouble linking them. For ex. third step asks for user's interests and I want to use age, supplied in step 1, to display only interests that are siutable for that age, etc. but at the same time I want to give the user the ability to move back to the previous steps up to the first one and make changes. So how do I keep the session and the post data between steps? Maybe insert it in mysql "on the fly" between steps? What's the best practice?

All help and advice are greatly appreciated. If you know about any tutorials for creating multistep registration please mention them.

tomda

6:28 am on Feb 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Never done multi-step registration, but I guess you have two evident way to proceed:
- Store data in your databse after every step
- Store data in session after every step
Personnally, I would go for the first solution.

Lastly, some of us (me included) who would never register if it requires more than one step! You better have a one-step quick registration page, then add a blinking link at the top of the page saying ("Update/Modify your profile").

dmmh

7:53 am on Feb 21, 2006 (gmt 0)

10+ Year Member



indeed....5 steps?
damn

phph

4:32 pm on Feb 21, 2006 (gmt 0)

10+ Year Member



Yeah, lol. I know 5 steps is a lot, but they are pretty short, just wanted to split them up thematically, also next steps will be dynamic depending on users' choices.

Now I think I'll be able to store data on every step, but I guess I'll still need to keep a session of some kind. How do I do that? Do you know of any good tutorials explaining how sessions work? Do I need to use cookies as well? All help and advice are greatly appreciated.

coopster

5:05 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, phph.

The PHP manual pages regarding Session Handling Functions [php.net] are a must read. Then you will likely find some good tutorials on the Zend web site.

[zend.com...]
[zend.com...]

There have been some very good posts in the WebmasterWorld PHP Forum here regarding sessions as well. There is one in particular regarding garbage collection and using sessions on a shared server that is important to understand. I put a bunch of those links in a recent thread when another member was asking some questions regarding sessions:

[webmasterworld.com...]

LifeinAsia

5:09 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



First, ask yourself if you REALLY need to make the process 5 steps? (Is this a user registration or an AA rehabilitation program? :) ) Assume that at each step, you're going to have a dropoff rate.

Second, answer yourself with a resounding NO!

Third, figure out how to rewite the process in 1-2 pages max.

One solution- put all the required registration information on the first page. Then have a link where users can go and refine their profile.

Another solution- use JavaScript to tailor later questios based on inputs from prior questions.

More complicated for you? Yes. Better user experience? IMHO, yes.

phph

4:34 am on Feb 22, 2006 (gmt 0)

10+ Year Member



Alright, I got another problem - now I'm trying to accomplish the following: when user submits form after step 1 (maybe after all the process will be just two steps) I do all the validations server-side and if any errors occur, I want to return the user to the same page, but have red text under all required fields that have been left blank or contain wrong info. And at the same time, have the rest of the info in place (so user doesnt need to enter it again, that includes passwords). How do I pass all that info from, say, step2.php back to step1.php? Any suggestions are appreciated!