www.z8games.com에서 로그인을 시도하고 설정 페이지로 이동합니다.이 코드는 제가 사용하고있는 코드이며 아래에 오류가 있습니다.cURL 로그인 및 리디렉션 [ASP.net 페이지]
<?php
$url = 'http://www.z8games.com/loging/globelogin.aspx?b=4&from=';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$html = file_get_contents($url);
preg_match('~<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"(.*?)\" />~',$html,$viewstate);
preg_match('~<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\" value=\"(.*?)\" />~',$html,$eventvalidation);
$vstate = $viewstate[1];
$eval = $eventvalidation[1];
$post_fields='__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=' . urlencode($vstate) . '&__EVENTVALIDATION=' . urlencode($eval) . '&tb_loginid=Heroboss123&tb_password=Droppers1&ib_login.x=11&ib_login.y=19';
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7s");
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Changing from page
curl_setopt($ch, CURLOPT_URL, "http://www.z8games.com/myaccount/myaccount.aspx");
$store = curl_exec($ch);
echo $store;
curl_close($ch);
?>
그것은이 반환
제안 된대로 "디버그 모드"를 활성화하려고 했습니까? aspx 페이지에 액세스 할 수 있습니까? 'z8games'도 귀하의 사이트입니까? –
z8games 이용 약관 위반으로 인해서는 안됩니다. –
사이트에 로그인하는 것에 대해 아무 것도 표시되지 않습니다. – Joery