tags:

views:

32

answers:

2

I am having issues creating a sticky for in PHP. It seems all the samples I can find online are using one pages for both the form and the processor. I have two separate pages. This is going to be a very long form and if a validation fails, and the user has to re-enter everything, they won't, they'll quit. So this is a vital feature for this form. Also, I am very new to PHP and haven't touched ASP for several years.

When all is said and done, this form will probably have over 50 items. It is using POST. What is the easiest way to convert my form to a sticky form?

The current form can be found here: http://family.themajdans.com/new_submission.php. Only the "Your Information" part works right now.

Any help would be appreciated.

+1  A: 

I suggest using a framework/library which already has support for this feature to generate the form. There are several. In fact, I think there are several dozen.

Borealid
@StayOutOfAsia +1
Michael Robinson
A: 

Why don't you do it like this (one file PHP)... Make sure everything is well sanitized before doing this. Just filter out invalid inputs, and leave valid ones to be reposted.

<input type="text" name="age" value="'.$post["age"].'"/>
Webarto
You have to do that for every ... single ... field. It's really, really easy to miss one.
Borealid
There about 15 inputs on his page, they are all text inputs, or he can use fw/lib :)
Webarto
There are 15 now. There will be close to 100 by the time I am done. I tried a couple frameworks and I can't customize them as much as I'd like. I tried php-form-builder-class but couldn't even get it to work right. So, guess I'm back to square one. I'll rewrite the form using a single page and see if I can find a good example online somewhere. I'm trying to figure all this out now before I get too far in the coding.
Nik