PHP와 cURL을 사용하여 제공된 사용자 자격 증명을 사용하여 웹 사이트에 로그인 할 수 있는지 확인하고 싶습니다. 이를 위해 현재 전체 웹 사이트를 검색하고 정규식을 사용하여 로그인이 작동하지 않는다는 것을 나타내는 키워드를 필터링합니다.cURL URL 주소 만 가져 오기
잘못된 사용자 이름/암호를 입력하면 url 자체에 "errormessage"문자열이 포함됩니다. 콘텐츠를 빠르게하지 않고 URL 주소를 얻기 위해 말리기 만 사용할 수 있습니까? 누군가가이 같은 문제를 처리하는 방법에 대한 좋은 아이디어가있는 경우
function curl_get_request($referer, $submit_url, $ch)
{
global $cookie_path;
// sends a request via curl to the string specifics listed
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
curl_setopt($ch, CURLOPT_URL, $submit_url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path);
return $result = curl_exec ($ch);
}
또한
이, 알려 주시기 바랍니다 :
은 여기 내 컬 PHP 코드입니다!