Need help with a PHP form

A month or so earler, i asked for help on php, forms ,etc.
Happy to announce, that I’ve setup the form. Works great. I get the results emailed, and added to an excel file. I have form validation working as well.
All is good, but now I have a new problem.
The survey is just too long for one page. It is basically 30 question, and I want to split it over 5-6 pages.

How do I do it. I’ve googled, and come up with different suggestions, like saving the results to a tmp file, using GET to store the results in the address bar, etc..

Can someone suggest the easiest method for a non-programmer like me ..?

Re: Need help with a PHP form

cookie :k:

Re: Need help with a PHP form

tmp file.. or cookie would be two choices to consider..

Re: Need help with a PHP form

session !

Re: Need help with a PHP form

how about 5-6 emails?

Re: Need help with a PHP form

no way man. i know it is the easiest option, but it’ll be too many emails.

Re: Need help with a PHP form

Hey, its still an option. Best way is to put it in the datebase, then just retrieve what u need.

Re: Need help with a PHP form

Yeh, using the ‘LIMIT’ option in MySQL query i.e. if you are using MySQL. But I’m sure other DBs have similar options.

Using a cookie is a good idea, I believe that’s how its done.

Re: Need help with a PHP form

Saving the info in session is another option !! I would say go for session !!

Happy Coding !

Re: Need help with a PHP form

I like the ideas, about session, and cookies, but don't have a clue on how to implement this :)

I'll be googling all out, but if you guys have any sites tha'll be helpful, that'll be awesome.

as i've said before, i'm not a coder, and if there is a ready made solution, that i can adapt to my project, it'll be perfect ..

Re: Need help with a PHP form

nomaan, you’ll have to play around with this because it’d be hard to have a pre-built situation to your problem.. its fairly easy though.

1- start a session at the top of every page with session_start(); when this function is called php basically sets up a session id, if none already exists, or loads the old variables if the session is already started. If you want to enable sessions permanentaly, then in your php.ini file, session.autostart variable to 1. Also, you’ll have to turn trans id’s to 1, if cookies are turned off in the user’s browser .. session.use_trans_id = 1

so lets say your questions are numbered var1 - var30.. on the first page, you do the following:
$_SESSION’var1’] = … ;
$_SESSION’var2’] = … ;

this session array will be available on all following pages.

Also, php provides a session_register function, if you do not want to use the session array: PHP: Manual Quick Reference

Re: Need help with a PHP form

I found this tutorial.
http://www.phpfreaks.com/tutorials/41/3.php
looks very good.
i’ve printed it out, and will let you guys know if i run into any problems

Re: Need help with a PHP form

goodluck nomaan :)