http://www.ps3-themes.com/에서 이미지를 가져오고 싶지만 직접 이미지 URL을 입력 할 때마다 작동하지 않습니다. 그것을 사이트의 주요 URL로 리디렉션합니다. 다음 코드를 사용하고 있습니다.PHP 컬에서 세션을 유지하는 데 도움이 필요합니다
$cookie_file = 'c:/tmp-cookie.txt';
$crl = curl_init();
curl_setopt($crl, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($crl, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($crl, CURLOPT_URL, "http://www.ps3-themes.com/wp-content/uploads/2011/03/11414-FordF150RaptorSVT.jpg");
curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($crl, CURLOPT_FOLLOWLOCATION, 1);
$html = curl_exec($crl);
if (file_exists($cookie_file)) {
print 'Created cookie file ' . $cookie_file;
} else {
print 'Could not create cookie file ' . $cookie_file;
}
나는 그것이 세션을 유지하지만 할 방법을 잘 필요 말할 수있다 구 .-
네, 맞습니다. 그럼 HTTP 리퍼러를 설정하는 방법 ?? – Anks
우수 !!! 그것은 일했다 :) 고맙다 alot :) – Anks