cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: PHP/Curl: Any Way to Follow a REFRESH Meta Tag?

From: Keller, Bryan <Bryan.Keller_at_pfizer.com>
Date: Tue, 15 May 2001 13:45:55 -0400

Ha! A solution. Apparently, I was doing the cookies wrong:

Whereas I was setting the cookie option multiple times...

curl_setopt ($ch, CURLOPT_COOKIE, $cookie1);
curl_setopt ($ch, CURLOPT_COOKIE, $cookie2);
curl_setopt ($ch, CURLOPT_COOKIE, $cookie3);

...it should really be:

curl_setopt ($ch, CURLOPT_COOKIE, $cookie1."; ".$cookie2."; ".$cookie3);

Otherwise the cookies overwrite one another.

Quick question:

when you use the CURLOPT_HTTPHEADER option, do you put all of your header
info in there (including cookies and authentication, or can it work with
other CURLOPTs...in PHP)?

Thanks,

\Bryan

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Tuesday, May 15, 2001 2:16 AM
To: Keller, Bryan
Cc: 'curl and php list '
Subject: RE: PHP/Curl: Any Way to Follow a REFRESH Meta Tag?

On Mon, 14 May 2001, Keller, Bryan wrote:

[ large chunk cut off ]

> HTTP Request 2 (no username/password, just the cookies - this should
> simulate the meta refresh in the browser, but doesn't):

You need to set the username/password in the second request as well. Curl
will not remember/store that for you in any way. Your ordinary browser does
that though. But of course you should pass on the cookies as well.

> HTTP/1.1 401 Unauthorized
> Server: Netscape-Enterprise/4.1
> Date: Mon, 14 May 2001 17:52:20 GMT
> WWW-authenticate: Basic realm="Pfizer Intranet ID"
> Content-length: 223
> Content-type: text/html
> Connection: close

This reply also indicates that there's a lack of "Basic" authorization in
the
previous request. Add your user/passwd pair there too and I think you'll get
better results!

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-05-15