Registration form in four steps

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cubeltd4
Forum Newbie
Posts: 5
Joined: Wed Sep 01, 2004 9:54 am
Location: Belgium

Registration form in four steps

Post by cubeltd4 »

Hello Folks,

I'm working on a registration form in 4 steps for my website. But i'm having some problems.

In step1 people can choose their country but when they select a country i use a submit(); to submit the form to file 2 pwizard2.php then i'll check their if they submitted the form via the button if not i'll get them back to file 1 pwizard1.php but the prob is i get not then the $_POST files to check which country they have choosed so i can get the correct states for the country.

Thats my big problem i want when they choosed another country the states are filled with the correct states for the country they choosed.
But i don't want to work via javascript. Thats why i need to fix a solution in step2 they can back to step1 but the values they filled in the fields must be saved.

Well if you don't understand what i mean please let me know i'll give it a try to explain it better :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

use sessions to save the data of the post in the second script/page so they can be prepopulated on the first script/page.
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

There's also a IE fix for IE 6

Code: Select all

session_start();
header("Cache-control: private"); //IE 6 fix
cubeltd4
Forum Newbie
Posts: 5
Joined: Wed Sep 01, 2004 9:54 am
Location: Belgium

Post by cubeltd4 »

Thanks i'll give it a try with session. Is this also possible to mak an session array?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

session data is an array. yes.
cubeltd4
Forum Newbie
Posts: 5
Joined: Wed Sep 01, 2004 9:54 am
Location: Belgium

Post by cubeltd4 »

thanks it works now fine. It's a great place here :)
cubeltd4
Forum Newbie
Posts: 5
Joined: Wed Sep 01, 2004 9:54 am
Location: Belgium

Post by cubeltd4 »

Little question is it possible to put the value from a file field in a variable? I'm working with 4 steps and in step 2 people can upload 4 images but i want everything should only happen at step 4 when they finished everything else.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can use javascript to read the filename they put into the file fields, however you cannot prefill a file field or differ the upload for later.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Yep.

Set whatever the value of the file field is, into a hidden textfield. And then parse that for processing on the next page.

If you google search for some [google]javascript form text field auto-fill snippet[/google], you should find just what you need.
Post Reply