1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
$ch = curl_init("https://imshealth.com/MobileIntelligence/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response=curl_exec ($ch);
$dom=new DOMDocument;
$dom->loadHTML($response);
$tags= $dom->getElementsByTagName('input');
for($i=0;$i<$tags->length;$i++){
$grab=$tags->item($i);
if($grab->getAttribute('name')==='__pageguid'){
$pageguid=$grab->getAttribute('value');
}
if($grab->getAttribute('name')==='__viewstateguid'){
$viewstateguid=$grab->getAttribute('value');
}
if($grab->getAttribute('name')==='__VIEWSTATE'){
$VIEW=$grab->getAttribute('value');
$VIEWSTATE=urlencode($VIEW);
}
if($grab->getAttribute('name')==='__VIEWSTATEGENERATOR'){
$VIEWSTATEGENERATOR=$grab->getAttribute('value');
}
}
$data= array(
"TimeZone" => "-60",
"WF_LOGIN_SIGNATURE_COMPONENT_MISSING" => "Signature+Component+not+registered",
"WF_LOGIN_DRTE_DLL_MISSING" => "Drte.dll+not+registered.",
"__EVENTTARGET" => "",
"__EVENTARGUMENT" => "",
"__pageguid" => $pageguid,
"__viewstateguid" => $viewstateguid,
"__VIEWSTATE" => $VIEWSTATE,
"__VIEWSTATEGENERATOR" => $VIEWSTATEGENERATOR,
"MMPRegistered" => "0",
"LoginID" => "admin",
"Password" => "admin",
"RememberMe" => "on",
"LoginButton" => "Sign+in",
);
curl_setopt($ch, CURLOPT_URL, "https://imshealth.com/MobileIntelligence/login.aspx");
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$response=curl_exec ($ch);
echo $response; |
Partager