Copy CodeThe code is as follows:
function Geturl ($url)
{
$ch = Curl_init ();
$timeout = 5;
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_connecttimeout, $timeout);
Add the following two lines to the Web page that requires user detection
curl_setopt ($ch, Curlopt_httpauth, Curlauth_any);
curl_setopt ($ch, Curlopt_userpwd, Us_name. ":". US_PWD);
$contents = curl_exec ($ch);
Curl_close ($ch);
$contents = Str_replace ("document.write ('", "", $contents);
$contents = Str_replace ("');", "", $contents);
$contents = Str_replace ("\\n", "", $contents);
$contents = str_replace ("\ \", "", $contents);
Echo $contents;
}
http://www.bkjia.com/PHPjc/324067.html www.bkjia.com true http://www.bkjia.com/PHPjc/324067.html techarticle Copy the code as follows: function Geturl ($url) {$ch = Curl_init (); $timeout = 5; curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ CH, curlopt_returntransfer, 1); curl_setopt ($c ...