[nycphp-talk] Passing some form values through to a redirected page...
webapprentice at onemain.com
Sat Feb 1 23:11:30 EST 2003
Jerry Kapron wrote:
>>So if you
>>post to /scriptA.php which does nothing except redirect to /scriptB.php,
>>scriptB.php will not actually see the submitted data, unless scriptA.php
>>it on the end of the redirected URL, like the browsers do. Either way, the
>>redirected script will have to use the GET method, even if the browser
>>was a POST method.
>That's not really true. Building a query string from POSTed data and
>appending it to the url in the header('Location: ..') call is not the only
>(and in fact ugly) 'solution'. See my previous message for details.
As a matter of preference, I prefer not exposing any data to the URL.
So I can either...
1) require() or include() the second page, so $HTTP_POST_VARS is
visible on the second page (George's idea)
2) create two utility functions and use sessioning to transfer data to
the next page (Jerry's idea)
More information about the talk