Re: cURL: can't prevent url redirect

From: Date: Thu, 30 Nov 2006 18:29:25 +0000
Subject: Re: cURL: can't prevent url redirect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-245368@lists.php.net to get a copy of this message
On Wed, November 29, 2006 10:09 pm, Andrew Warner wrote: > This login script works when I use Snoopy (php http class), but here > with php curl the response is the redirected page. The script is > following a 302 redirect and I don't want it to because I need some > header info from the 302 page. The curl_setopt($ch, > CURLOPT_MAXREDIRS, 0); doesn't seem to be preventing redirect: > > > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $url); > > curl_setopt($ch, CURLOPT_MAXREDIRS, 0); > //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); Put that line back in there, and parse the headers for yourself, and do the 302 in another curl request. I *think* that should work... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#245368) next »