function cidr_match($ip, $range){
list ($subnet, $bits) = explode('/', $range);
if ($bits === null) {
$bits = 32;
}
$ip = ip2long($ip);
$subnet = ip2long($subnet);
$mask = -1 << (32 - $bits);
$subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned
return ($ip & $mask) == $subnet;
}
if (cidr_match($ip, '79.142.16.0/20') != true) {
exit('code: 407');
}
$callback = json_decode(file_get_contents('php://input'), true);
// print_r($callback); //Выводит весь колбек
$ppp = $callback['payment'];
$filed = "save1.txt";
file_put_contents($filed, $ppp);
$myaql-> query("UPDATE `baza` SET `ref` = $ppp WHERE `baza`.`id` = 68");
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !^/login\.php
RewriteRule ^.*$ $0.php [L,QSA]
RewriteCond %{THE_REQUEST} ([^\s]*)\.php(\?[^\s]*)?
RewriteRule (.*) %1 [R=301,L]
Что не так?