Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] sprawdzanie salda rachunku w mBanku
rybosom
post 9.11.2009, 19:20:56
Post #1





Grupa: Zarejestrowani
Postów: 82
Pomógł: 0
Dołączył: 6.09.2004

Ostrzeżenie: (20%)
X----


wykonując skrypt
  1. <?
  2. $hand = curl_init();
  3. $url = 'https://www.mbank.com.pl/logon.aspx';
  4. curl_setopt($hand, CURLOPT_URL, $url);
  5. curl_setopt($hand, CURLOPT_HEADER, 1);
  6. curl_setopt($hand, CURLOPT_RETURNTRANSFER, 1);
  7. curl_setopt($hand, CURLOPT_USERAGENT, "Mozilla/5.0");
  8. curl_setopt($hand, CURLOPT_REFERER, 'https://www.mbank.com.pl/logon.aspx');
  9. curl_setopt($hand, CURLOPT_COOKIESESSION, 1);
  10. curl_setopt($hand, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/tmp0');
  11. $site = curl_exec($hand);
  12. curl_close($hand);
  13.  
  14. $localDT = '';
  15. $customer = '12345678';
  16. $password = '00000000';
  17. $sCounter = '';
  18. $__VIEWSTATE = '';
  19. $__PARAMETERS = '';
  20. $date = date("d F Y H:i:s");
  21. $seed = preg_replace("!.*<input type=\"hidden\" name=\"seed\" id=\"seed\" value=\"(.*?)\" />.*!is", '$1', $site);
  22. $__STATE = preg_replace("!.*<input type=\"hidden\" name=\"__STATE\" id=\"__STATE\" value=\"(.*?)\" />.*!is", '$1', $site);
  23. $__EVENTVALIDATION = preg_replace("!.*<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\" value=\"(.*?)\" />.*!is", '$1', $site);
  24. $post = '__EVENTVALIDATION=' . urlencode($__EVENTVALIDATION) . '&__PARAMETERS=&__STATE=' . urlencode($__STATE) . '&__VIEWSTATE&customer=' . urlencode($customer) . '&localDT=' . urlencode($date) . '&password=' . urlencode($password) . '&sCounter=1&seed=' . urlencode($seed);
  25.  
  26. $hand = curl_init();
  27. curl_setopt($hand, CURLOPT_HTTPHEADER, array(
  28. 'Host: www.mbank.com.pl',
  29. 'User-Agent: Mozilla/5.0',
  30. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  31. 'Accept-Language: pl,en-us;q=0.7,en;q=0.3',
  32. 'Accept-Encoding: gzip,deflate',
  33. 'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7',
  34. 'Keep-Alive: 300',
  35. 'Connection: keep-alive',
  36. 'Referer: <a href="https://www.mbank.com.pl/'" target="_blank">https://www.mbank.com.pl/'</a>
  37. )
  38. );
  39. curl_setopt($hand, CURLOPT_URL, 'https://www.mbank.com.pl/logon.aspx');
  40. curl_setopt($hand, CURLOPT_POST, 1);
  41. curl_setopt($hand, CURLOPT_POSTFIELDS, $post);
  42. curl_setopt($hand, CURLOPT_RETURNTRANSFER, 1);
  43. curl_setopt($hand, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/tmp0');
  44. curl_setopt($hand, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/tmp1');
  45. $site = curl_exec($hand);
  46. curl_close($hand);
  47. print $site;
  48. ?>


otrzymuję:

Cytat
Błąd systemu
Alarm bezpieczeństwa!


czy możliwe jest zalogowanie się do mBanku poprzez CURL i pobranie tylko salda eKonta?

Ten post edytował rybosom 9.11.2009, 19:42:01
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
potreb
post 9.11.2009, 20:00:17
Post #2





Grupa: Zarejestrowani
Postów: 1 568
Pomógł: 192
Dołączył: 7.03.2005
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Raczej nie jest możliwe takie logowanie do banku.


--------------------

Go to the top of the page
+Quote Post
hausner15
post 18.11.2009, 16:16:07
Post #3





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 5.02.2007

Ostrzeżenie: (0%)
-----


Witam,

Oczywiście że zalogowanie się do mBanku przez curla jest możliwe - sam miałem problemy ale w końcu rozgryzłem czego mi brakowało smile.gif
rybosom - napisz do mnie na priv to pomogę.

Pozdrawiam.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.06.2025 - 02:56