libcurl - PHP Curl followlocation working from command line but not from browser -
i have written small script scrape data website using curl in php. when curl executed, there 301-redirect issued site taken care of :
curl_setopt($ch, curlopt_followlocation, true);
however, when run same code browser, redirect not working. here complete curl request:
$ch = curl_init(); curl_setopt($ch, curlopt_url, $arr_params['url']); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_httpauth, curlauth_any); curl_setopt($ch, curlopt_followlocation, true); curl_setopt($ch, curlopt_timeout, 60); curl_setopt($ch, curlopt_useragent, "mozilla/4.0 (compatible; msie 5.01; windows nt 5.0)"); curl_setopt($ch, curlopt_verbose, true); curl_setopt($ch, curlopt_stderr, $arr_params['error_file']); curl_setopt($ch, curlopt_maxredirs, 5); //curl_setopt($ch, curlopt_http_version, curl_http_version_1_0);
in above code, $arr_params set previously....
Comments
Post a Comment