retain form data

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
pugs
Forum Newbie
Posts: 5
Joined: Tue Jun 24, 2008 5:28 pm

retain form data

Post by pugs »

Hi,

hope this is the place for help! :)

I have a registration form which new visitors to the site can use to become members.

My problem is when the form is submitted it's passed to another page for validation, if invalid it redirects back to the form. However is there a way to retain the data the user has inputted, so no need to re-fill the form?

ANY help appreciated

Thanks

Lisa
User avatar
Inkyskin
Forum Contributor
Posts: 282
Joined: Mon Nov 19, 2007 10:15 am
Location: UK

Re: retain form data

Post by Inkyskin »

When creating forms, I usually post the page to itself, and do the form processing first (If the post data exists). This way if there are errors, I already have the posted data to repopulate the form with (Saves messing around with sessions/cookies etc). If there are no errors, then redirect to the next page.
Post Reply