Re: Redirecting and get length problems
| From: | John W. Holmes | Date: | Thu, 08 Jan 2004 00:54:46 +0000 |
| Subject: | Re: Redirecting and get length problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174027@lists.php.net to get a copy of this message | ||
Chris W wrote:
In this application I am working on, if there is a problem with the data, I use a redirect to go back to the form and send the data with an error message in a get. That way the user doesn't need to retype everything. Most errors can be caught with java script before they post the form but not all. 3 of the fields in this form are to store various URL's so if they are long URL's it is easy to see how I could go over the limit of the max url length. So my question is what is the best alternative? Is there a way to redirect and use a post instead of a get to send the data? The only other Idea I have is to put the information in a temporary table and just send a get with the key for the record in the table.Easy way is with sessions. Throw $_GET into session and pull it back out on the next page. $_SESSION['get'] = $_GET; $_GET = $_SESSION['get']; As an alternative, how about you rethink the flow of your page? Make the part that displays your form into a function, class, or include file. Then you can just include it wherever you need it, without the need to actually redirect back to another page. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com