1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
$ch = curl_init();
if($ch){
$options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_USERPWD =>"login:passwd",
CURLOPT_FOLLOWLOCATION => TRUE,
CURLOPT_UNRESTRICTED_AUTH => TRUE,
CURLOPT_HTTPPROXYTUNNEL => TRUE,
CURLOPT_PROXY => '10.X.X.X:3128',
CURLOPT_TIMEOUT => 60,
CURLOPT_CONNECTTIMEOUT => 60,
);
curl_setopt_array($ch, $options);
$output = curl_exec($ch);
if( $output === FALSE)
echo 'error : '.curl_error($ch).'<br />';
var_dump($output);
curl_close($ch); |
Partager