Jump to content

Handling form validation and maintaining form values...


hal10001

Recommended Posts

The topic is very similar to this post, but a little different:

 

http://www.phpfreaks.com/forums/index.php/topic,183392.0.html

 

I want to follow an MVC design pattern, with a view and controller. The view passes form values to the controller, and then the controller validates the input. In the case where there is an error, I need to redirect back to the view, keeping the values that were initially entered by the user. I know how to do this by appending query string variables to the return URL, but I have a ton of form data, with textarea fields, etc., and I need to know what is an alternative for sending this information back to the view. How do frameworks typically do this sorta thing -- is it by adding the values and errors to a session before redirecting? Someone suggested to me on another message board to use cURL and request the original view from the controller, render it, and fill in the form values that were submitted. That sounds like overkill, so I wanted to ask here. Thanks!!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.