Re: HTTP_Clients and Files - Part 2
| From: | Justin Patrin | Date: | Mon, 15 Nov 2004 21:16:13 +0000 |
| Subject: | Re: HTTP_Clients and Files - Part 2 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15548@lists.php.net to get a copy of this message | ||
On Mon, 15 Nov 2004 15:24:23 -0500, Andrew Nagy <asnagy@webitecture.org> wrote:
> Okay, I got HTTP_Client to work with files no problem (on some forms)
> however, the forms that use a session in the qurey string is causing me
> problems.
>
> Here is one scenario:
>
> 1. HTTP_Client posts my username and password info to a login page.
> 2. I am then redirected to a page that now presents me with a session id
> in the query string.
> 3. When I click on the submit button to download the file, i need to
> pass the session id as a hidden variable to the form.
>
> How can I get a variable from the query string from one post() response
> and then send it to my next post()?
>
> Anyone have any experience with this?
>
Yes, I have experience doing all sorts of crazy things with
HTTP_Client. Usually sessions use cookies, which HTTP_Client handles
for you. If it is indeed in a hidden field in the form, then you're
going to have to parse out the value and set it yourself in your post
request. I suggest using preg_match(). If you need regex help, post
the relevant part of the form HTML and we can try to help.
--
Justin Patrin