Re: PEAR::HTTP_REQUEST -> HTTP_CLIENT
| From: | Justin Patrin | Date: | Thu, 27 Jan 2005 21:00:07 +0000 |
| Subject: | Re: PEAR::HTTP_REQUEST -> HTTP_CLIENT | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17225@lists.php.net to get a copy of this message | ||
On Thu, 27 Jan 2005 21:05:18 +0100, hugo <hugo123fr@hotmail.com> wrote:
> As I said in the first message below, I tried to navigate on my website with
> Http_request and Justin answer me that I have to use Http_client. So I
> tested like this :
>
> require_once 'Client.php';
This should be require_once('HTTP/Client.php'); If you're doing it
this way your PEAR installation is not set up correctly. You *will*
get inclusion errors if you do it this way.
[snip]
> $res = $client->post ( http://localweb/login.php,
> $arrayParam);
[snip]
> $res = $client->get(http://localweb/printNewsAdmin.php);
[snip]
Put quotes around those URLs.
'http://localweb/login.php'
>
> And I get "Failed after 2nd request "
> I don't know how to keep cookies et session variable.
> Any idea ?
What's the PEAR error say?
>
> ----- Original Message -----
> From: "Justin Patrin" <papercrane@gmail.com>
> To: "Lassiege Hugo" <hlassiege@sopragroup.com>
> Cc: <pear-general@lists.php.net>
> Sent: Tuesday, January 25, 2005 5:12 PM
> Subject: Re: [PEAR] PEAR::HTTP_REQUEST
>
> > On Tue, 25 Jan 2005 10:50:30 +0100, Lassiege Hugo
> > <hlassiege@sopragroup.com> wrote:
> > > Hi,
> > > This is the first time I use this mailing list so I hope that I didn't
> make a mistake.
> > >
> > > I try to made test with HTTP_REQUEST package yesterday. I am connecting
> to my own website and then I verify that I am correctly logged in. If it's
> correct, I try to print a page.
> > > I use to following code :
> > >
> > [snip]
> > > But it doesn't keep session variable and the second request
> (HTTP_REQUEST_METHOD_GET) give me the loggin screen because the
> authentification failed.
> > >
> > > Is it possible to keep session variable and to navigate into my website
> like this ?
> > >
> >
> > HTTP_Request only makes *single* requests, it's not set up to keep
> > state information (aka cookies). HTTP_Client, which uses HTTP_Request,
> > will do this.
> >
--
Justin Patrin