[vox-tech] Question about php settings and passing form data

Troy Arnold vox-tech@lists.lugod.org
Tue, 4 Feb 2003 22:07:58 -0800


On Tue, Feb 04, 2003 at 06:06:49PM -0800, ME wrote:
> Hello,
> 
> I want to use a php redirector
> header('Location: http://website.nofun/redirect.....)
> and I want to pass to the page ref-ed in the URI a number of FORM variables.
> 
> However, I am meeting with little luck on this.
> 
> If I encode the variables as part of the URL with "&" as a separator, I
> dcan get the form data and variables that store them (names) to pass
> through to the page.

Clarifying, you *can* get the above to work as it should?

> However, use of
> $_SESSION["var_name"] = "var value";
> Does not pass the variable or data, and use of
> session_register('variable_name');
> is also proving fruitless. (I only used one or the other (_SESSION vs
> session_register()) not both.)
> 
> I expect this should work, but cannot find mention of setting for
> controlling this. (I even tried avoiding the appearance int he URL by
> encoding a \r\nvarname:%20var%20value\r\n to fool the client into passing
> the URL with header data separate. No go.
> 
> Suggestions on what config settings should be examined within php to
> ensure that form data can be passed as it should, in the HTTP header with
> PHP 4.3.0?

Session data in PHP is not passed as part of the HTTP request.  By
default sessions are stored in whatever container your session handler
provides (like a database, for example).  The default session handler
stores the session as a flat file in /tmp, unless you're smart/paranoid
and have changed the value for session.save_path.  What *is* passed is
the session id, via either GET, POST or cookies.

To see if the sessid is geting passed through your redirect, try:
echo session_id();
Make sure it's the same on the page before the redirect and on the page
after.

Also, the php function phpinfo() can be useful for debugging.

Did I understand your problem correctly?  If not, please clarify.

-troy