Debe intentar algo como esto, Estoy haciendo esto para mi proyecto, es un sistema de respaldo
//function to get the remote data
function url_get_contents ($url) {
if (function_exists('curl_exec')){
$conn = curl_init($url);
curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($conn, CURLOPT_FRESH_CONNECT, true);
curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);
$url_get_contents_data = (curl_exec($conn));
curl_close($conn);
}elseif(function_exists('file_get_contents')){
$url_get_contents_data = file_get_contents($url);
}elseif(function_exists('fopen') && function_exists('stream_get_contents')){
$handle = fopen ($url, "r");
$url_get_contents_data = stream_get_contents($handle);
}else{
$url_get_contents_data = false;
}
return $url_get_contents_data;
}
luego se puede hacer como esto
$data = url_get_contents("http://www.google.com");
if($data){
//Do Something....
}
Es parte SITE_PATH de * su * sitio? ¿O es en otro lugar? – VoteyDisciple
Es parte de mi sitio. SITE_PATH = 'http://mydomain.com/'; – JasonS
posible duplicado de [Cómo raspar sitios web cuando cURL y allow_url_fopen está deshabilitado] (http://stackoverflow.com/questions/3880628/how-to-scrape-websites-when-curl-and-allow-url-fopen-is -disabled) – Gordon