0
나는 rapidshare와 다른 업로드 호스트에 링크가 있습니다. curl 및 file_get_contents로 소스 코드를 가져 와서 "삭제"를 검색했으나 일부 호스트에서 소스 코드를 가져올 수 없습니다.PHP에서 html 소스 코드 얻기
일부 호스트에서는 curl이 작동하고 있고 다른 file_get_contents가 작동하지만 대부분이 소스 코드를 반환하지 않습니다.
여기 컬 내 코드입니다 :
function curl_download($Url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
$agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch,CURLOPT_VERBOSE,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch,CURLOPT_SSLVERSION,3);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
$output = curl_exec($ch);
curl_close($ch);
return $output;
여전히 작동하지 않는 것이 작동 바랍니다. 소스 코드를 얻었지만 사이트를 열어 소스 코드를 보면 소스 코드와 다를 바 없습니다. 소스 코드 앞에 다음과 같이 표시됩니다. HTTP/1.1 200 OK 캐시 제어 : 개인 Content-Length : 7036 Content-Type : text/html; charset = utf-8 서버 : Microsoft-IIS/7.5 X-AspNet- 버전 : 2.0.50727 Set-Cookie : – user1104615
HTTP 헤더입니다. – ceejayoz