RE: [PHP] POST on redirects?
| From: | Brady Mitchell | Date: | Fri, 28 Jul 2006 22:11:37 +0000 |
| Subject: | RE: [PHP] POST on redirects? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239864@lists.php.net to get a copy of this message | ||
Use sessions. Store the variables you need in the session, then
redirect. After redirect get the values you need from the session.
http://us3.php.net/manual/en/ref.session.php
Brady
> -----Original Message-----
> From: Tony Di Croce [mailto:dicroce@gmail.com]
> Sent: Friday, July 28, 2006 2:56 PM
> To: php-general@lists.php.net
> Subject: [PHP] POST on redirects?
>
> In a couple of my scripts, I do something like the following
> when I detect
> an improperly submitted form:
>
> ** if( !valid_string( $_POST['firstname'] ) )
> {
> $return_url =
> "https://www.abc.com/checkout_phase1.php?error=FirstName
> Required";
> header( "location: $return_url" );
> exit(0);
> }
>
> Recently I changed the code so that a big variable that was
> being passed via
> GET (IE, as a param in the URL) is instead being POST'd...
> (typically, via a
> hidden INPUT elem in a form)...
>
> Unfortunatley, this broke my error handling logic... Is it
> possible to add
> POST variables to a redirect? How?
>
> --
> Free Linux Technical Articles
> http://www.linuxtecharticles.com
>