
vMyth - 2008-04-29 13:03:47
<?
require("http.php");
function get_html($url, $array = "") {
$http = new http_class;
$http->follow_redirect = 1;
$http->debug = 0;
$http->debug_response_body = 0;
$http->html_debug = 1;
$http->user_agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
$http->follow_redirect=1;
$http->redirection_limit=5;
$http->exclude_address="";
$http->prefer_curl=0;
$error=$http->Open($arguments);
if($error=="") {
$error=$http->SendRequest($arguments);
if($error=="") {
$headers=array();
$error=$http->ReadReplyHeaders($headers);
if($error=="") {
for(;;) { $error=$http->ReadReplyBody($body,1000);
}
}
}
$http->Close();
}
if(strlen($error)) {
return false;
} else {
return $body;
}
}
echo get_html("http://www.google.com");
?>
I'm about creating a simple function to get page HTML but it always raise the number of Apache processes in my computer to 50 or 100. Can you tell me why please ? Thanks.