Размер файла: 942B
<?php
$http=$_SERVER['HTTP_HOST'];
$geturl = 'http://swapart.h2m.ru/license/mysql.php?site='.$http.'&code='.$code.'';
if (@file_get_contents($geturl)) {
$data = file_get_contents($geturl);
} else {
$user_agent = 'Mozilla/5.0'
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $geturl);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_REFERER, $geturl);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
$data = curl_exec ($ch);
curl_close ($ch);
}
print "$active/$nolicensed/$cancel/0/TEST";
$active = (stristr($data, '<!--ACTIVE-->')) ? 1 : 0;
$nolicensed = (stristr($data, '<!--NO_LICENSED-->')) ? 1 : 0;
$cancel = (stristr($data, '<!--CANCEL-->')) ? 1 : 0;
if(!empty($nolicensed)) die($lang['block']."</body></html>");
elseif(!empty($cancel)) die($lang['cancel']."</body></html>");
?>