<? $hand = curl_init(); $url = 'https://www.mbank.com.pl/logon.aspx'; curl_setopt($hand, CURLOPT_URL, $url); curl_setopt($hand, CURLOPT_HEADER, 1); curl_setopt($hand, CURLOPT_RETURNTRANSFER, 1); curl_setopt($hand, CURLOPT_USERAGENT, "Mozilla/5.0"); curl_setopt($hand, CURLOPT_REFERER, 'https://www.mbank.com.pl/logon.aspx'); curl_setopt($hand, CURLOPT_COOKIESESSION, 1); $site = curl_exec($hand); curl_close($hand); $localDT = ''; $customer = '12345678'; $password = '00000000'; $sCounter = ''; $__VIEWSTATE = ''; $__PARAMETERS = ''; $seed = preg_replace("!.*<input type=\"hidden\" name=\"seed\" id=\"seed\" value=\"(.*?)\" />.*!is", '$1', $site); $__STATE = preg_replace("!.*<input type=\"hidden\" name=\"__STATE\" id=\"__STATE\" value=\"(.*?)\" />.*!is", '$1', $site); $__EVENTVALIDATION = preg_replace("!.*<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\" value=\"(.*?)\" />.*!is", '$1', $site); $hand = curl_init(); 'Host: www.mbank.com.pl', 'User-Agent: Mozilla/5.0', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: pl,en-us;q=0.7,en;q=0.3', 'Accept-Encoding: gzip,deflate', 'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7', 'Keep-Alive: 300', 'Connection: keep-alive', 'Referer: <a href="https://www.mbank.com.pl/'" target="_blank">https://www.mbank.com.pl/'</a> ) ); curl_setopt($hand, CURLOPT_URL, 'https://www.mbank.com.pl/logon.aspx'); curl_setopt($hand, CURLOPT_POST, 1); curl_setopt($hand, CURLOPT_POSTFIELDS, $post); curl_setopt($hand, CURLOPT_RETURNTRANSFER, 1); $site = curl_exec($hand); curl_close($hand); ?>
otrzymuję:
Cytat
Błąd systemu
Alarm bezpieczeństwa!
Alarm bezpieczeństwa!
czy możliwe jest zalogowanie się do mBanku poprzez CURL i pobranie tylko salda eKonta?