{% else-1 %}
функция определение ip-адресов

                        
function RealIP ()
{
if( $_SERVER [ 'HTTP_X_FORWARDED_FOR' ] != '' )
{
$client_ip =
( !empty( $_SERVER [ 'REMOTE_ADDR' ]) ) ?
$_SERVER [ 'REMOTE_ADDR' ]
:
( ( !empty( $_ENV [ 'REMOTE_ADDR' ]) ) ?
$_ENV [ 'REMOTE_ADDR' ]
:
"unknown" );
$entries = split ( '[, ]' , $_SERVER [ 'HTTP_X_FORWARDED_FOR' ]);
reset ($entries );
while (list(, $entry ) = each ($entries ))
{
$entry = trim ($entry );
if ( preg_match ( "/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/" , $entry , $ip_list ) )
{
$private_ip = array(
'/^0\./' ,
'/^127\.0\.0\.1/' ,
'/^192\.168\..*/' ,
'/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/' ,
'/^10\..*/' );
$found_ip = preg_replace ( $private_ip , $client_ip , $ip_list [ 1 ]);
1 26 0
0

Нет фото
Chainsaw * [мошенник]
• 27 дек 2014, 15:16


шо за бидлокод *