curl-and-php
RE: 47 - Maximum (20) redirects followed -- bug?
Date: Tue, 19 Sep 2006 09:28:50 +0200
When you look at the headers which are received then your address gives a
redirect 302. Object moved.
In the header you'll also find the new location of the object:
Location: /Default.aspx?wa=getpaidnow&AspxAutoDetectCookieSupport=1
And that's the page which you see.
So when there is a 302 header code then follow location. That has to be put
into your code.
Luck
-----Oorspronkelijk bericht-----
Van: curl-and-php-bounces_at_cool.haxx.se
[mailto:curl-and-php-bounces_at_cool.haxx.se] Namens All4Hosting .
Verzonden: maandag 18 september 2006 23:52
Aan: curl-and-php_at_cool.haxx.se
Onderwerp: 47 - Maximum (20) redirects followed -- bug?
Hi
I'm writing a URL checker, I'm fetching URL's using the code below, however
the code always fails to retreive the URL shown below, giving the error "47
- Maximum (20) redirects followed"
But if I paste the same URL in a browser is loads fine.
Is this a bug in the curl code?
is there anything I can do to fetch the URL?
****************
$url = "http://YTB.com/GetPaidNow";
$ch=curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.1.4322)');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$buf = curl_exec ($ch);
$errnum = curl_errno($ch);
echo curl_errno($ch) . " - " . curl_error($ch) . "<br>";
curl_close ($ch);
****************
Thanks
Peter
_________________________________________________________________
Download the new Windows Live Toolbar, including Desktop search!
http://toolbar.live.com/?mkt=en-gb
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-09-19