NYCPHP Meetup

NYPHP.org

[nycphp-talk] Passing some form values through to a redirected page...

Webapprentice 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
>>    
>>
>sticks
>  
>
>>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
>>    
>>
>request
>  
>
>>was a POST method.
>>...
>>George Webb
>>    
>>
>
>George,
>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.
>
>Jerry
>  
>
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)
or
2) create two utility functions and use sessioning to transfer data to 
the next page (Jerry's idea)

--Stephen




More information about the talk mailing list