${font Travelcons:size=20}%${font} ${voffset -2}Баланс 89107228611${alignr}${execi 1800 curl
руб.
<?
$tempFile = tempnam ("", "COOK_");
function fcurl($urlstart,$urlfinish,$post,$tempFile)
{
$cur = curl_init();
curl_setopt($cur, CURLOPT_URL, $urlstart);
curl_setopt($cur, CURLOPT_COOKIEJAR, $tempFile);
curl_setopt($cur, CURLOPT_COOKIEFILE, $tempFile);
curl_setopt($cur, CURLOPT_USERAGENT, "Opera/10.00 (Windows NT 5.1; U; ru) Presto/2.2.0");
curl_setopt($cur, CURLOPT_REFERER, $urlfinish);
curl_setopt($cur, CURLOPT_POST, 1);
curl_setopt($cur, CURLOPT_POSTFIELDS, $post);
curl_setopt($cur, CURLOPT_HEADER, 0);
curl_setopt($cur, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($cur, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($cur, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($cur, CURLOPT_RETURNTRANSFER,1);
$rez = curl_exec($cur);
curl_close($cur);
return $rez;
};
$nomer = 'nomer';
$pasport = 'pass';
$us = 'https://ihelper.mts.ru/selfcare/logon.aspx';
$uf = 'https://ihelper.mts.ru/selfcare/logon.aspx';
$p = '0';
$r = fcurl($us,$uf,$p,$tempFile);
preg_match("/id=\"__VIEWSTATE\".*\"(.*?)\"/", $r, $matches);
$post1=$matches[1];
$post1 = urlencode($post1);
// êëåèì ñòðîêó ïîñò
$p = "__VIEWSTATE=$post1&ctl00%24MainContent%24tbPhoneNumber=$nomer&ctl00%24MainContent%24tbPassword=$pasport&ctl00%24MainContent%24btnEnter=%D0%92%D0%BE%D0%B9%D1%82%D0%B8";
$us = 'https://ihelper.mts.ru/selfcare/logon.aspx';
$uf = 'https://ihelper.mts.ru/Selfcare/welcome.aspx';
$r = fcurl($us,$uf,$p,$tempFile);
$us = 'https://ihelper.mts.ru/selfcare/account-status.aspx';
$uf = 'https://ihelper.mts.ru/selfcare/account-status.aspx';
$p = '0';
$r = fcurl($us,$uf,$p,$tempFile);
$r = iconv("UTF-8", "Windows-1251", $r);
preg_match("/<td class=\"right\">(.+?)<\/td>/", $r, $matches);
$str=str_replace('\r\n','',$matches[1]);
echo trim($str);
?>