Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require('simple_html_dom.php');
- //username and password of account
- $username = htmlspecialchars($_SESSION['email']);
- $password = htmlspecialchars($_SESSION['password']);
- $url = "https://wallet.gelredome.nl/nl/login";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.107 Chrome/32.0.1700.107 Safari/537.36');
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "Email=$username&Password=$password");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_COOKIESESSION, true);
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-name'); //could be empty, but cause problems on some hosts
- curl_setopt($ch, CURLOPT_COOKIEFILE, '/var/www/ip4.x/file/tmp'); //could be empty, but cause problems on some hosts
- $answer = curl_exec($ch);
- if (curl_error($ch)) {
- echo curl_error($ch);
- }
- //another request preserving the session
- curl_setopt($ch, CURLOPT_URL, 'https://wallet.gelredome.nl/nl/');
- curl_setopt($ch, CURLOPT_POST, false);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "");
- $answer = curl_exec($ch);
- if (curl_error($ch)) {
- echo curl_error($ch);
- die;
- }
- $html = new simple_html_dom();
- $html->load($answer);
- $amount = $html->find('span.c-wallet-banner__currency-amount', 0);
- $symbols = array('$', '€', '£');
- //echo "€"; //if you want to display Euro sign, just uncomment
- if($amount == ""){
- session_destroy();
- die;
- }
- echo str_replace($symbols, '', $amount->innertext);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement