<?
$srv =
array(
'188.93.20.139',
'188.93.20.139',
'109.234.155.197',
'109.234.155.198',
'109.234.156.250',
'109.234.156.251'
);
$srv_rnd = mt_rand(0,4);
if(isset($_POST['submit']) and isset($_GET['send']))
{
$id=$_POST['id'];
$auth_key=$_POST['auth_key'];
function ex($string, $from, $to)
{
$string = explode($from, $string, 2);
$string = explode($to, $string[1], 2);
return $string[0];
}
function parse(&$parse)
{
global $response;
foreach ($parse as $k => $v) {$parse[$k] = ex($response, '<'.$k.'>', '</'.$k.'>');}
}
$c = curl_init('http://' . $srv[$srv_rnd] . '/prison/universal.php?method=getInfo&user='.$id.'&key='.$auth_key);
$header = array (
'109.234.156.252',
'User-Agent: Mozilla/5.0 AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'Accept-Language: en-us,en;q=0.5',
'Accept-Encoding: gzip,deflate',
'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Connection: close'
);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($c, CURLOPT_HTTPHEADER, $header);
curl_setopt($c, CURLOPT_HEADER, 0);
curl_setopt($c, CURLOPT_NOBODY, 0);
$response = curl_exec($c);
curl_close($c);
$parse = array(
'rating' => '',
'energy'=> '',
'masters_love' => '',
'money' => '',
'sugar' => '',
'diamond' => '',
'toilet_paper' => '',
'soap' => '',
'basePopularity' => ''
);
parse($parse);
print_r($parse);
}else{
echo '<form action="?send" method="POST">
ID:<br />
<input name="id" /><br />
Auth_key:<br />
<input name="auth_key" />
<input name="submit" type="submit" value="Войти" />
</form>';
}
?>