PHP Sticky forms

Associate
Joined
6 Mar 2009
Posts
495
I have a form which when submitted enters the data into an database and it is validated using JS to check that there are no empty fields. When i enter data and hit submit it runs the php code, inserts into the database and then redirects the user to the home page.

The problem i am having is that it works fine if there are no empty fields but when there are empty field it tells the user what fields are empty and then redirects to the home page which then looses the users info that they put into the form.

I have read about php sticky forms which will reload the page and keep the users info if there is an error. But this seems to use $_SERVER['PHP_SELF']; as the form action therefore that wont run my php code on sumbit. If you know what i mean!

Basically would like to keep the users info in the fields if an error occurs on submission.

Any suggestions please.
 
Back
Top Bottom