define('LIVELOAD_ID', md5($_SERVER['REQUEST_URI']+'countLiveLoad'));
if(isset($_SESSION['LL']) && @count($_SESSION['LL'])>7) {
$_SESSION['LL'] = array ();
}
if(isset($_POST['liveload']) && $_POST['liveload'] == 1) {
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest"){
@header ("HTTP/1.0 403 Forbidden");
die("We love you too :]");
}
@header( "Content-type: text/html; charset=windows-1251" ); // если у вас кодировка UTF, закоментируйте эту строку
//@header( "Content-type: text/html; charset=utf-8" ); // если у вас кодировка windows, закоментируйте эту строку
if(!$_SESSION['LL'][LIVELOAD_ID]) {
$_SESSION['LL'][LIVELOAD_ID] = 1;
}else{
$_SESSION['LL'][LIVELOAD_ID] ++;
}
if(!$_GET['cstart']){
$_GET['cstart'] = $_REQUEST['cstart'] = 1;
}
$_GET['cstart'] = $_REQUEST['cstart'] = $_REQUEST['cstart'] + $_SESSION['LL'][LIVELOAD_ID];
}elseif($_SESSION['LL'][LIVELOAD_ID]){
$_SESSION['LL'][LIVELOAD_ID] = 0;
}