Вход Регистрация
Файл: 4mast/profmas.ru/modules/works/whois/ip.php
Строк: 26
<?
require_once('../../../includes/Headers.php');
require_once(
'../../../includes/PDO_func.php');

if(
$us['id'] == false){

header('location: /login/auth');

exit;

}
H( 'WHOIS IP', 'WHOIS IP' );
echo 
'<div class="list1">  
 <form method="get" action="/modules/works/whois/ip.php">  
 <input type="text" name="ip" size="15" value="">  
 <input type="submit" value="Вперед"/>  
 </form>  
</div>'
;
$_GET[ 'ip' ] = htmlspecialchars( addslashes( trim( $_GET[ 'ip' ] ) ) );
if ( !empty( 
$_GET[ 'ip' ] ) )
    echo 
whois( "whois.ripe.net", $_GET[ 'ip' ] );
function 
whois( $url, $ip ) {
    
$sock = fsockopen( $url, 43, $errno, $errstr );
    if ( !
$sock )
        exit( 
"$errno($errstr)" );
    else {
        echo 
'<div class="list2">' . $url . '<br/></div>';
        
fputs( $sock, $ip . "rn" );
        
$text = "";
        while ( !
feof( $sock ) ) {
            
$text .= fgets( $sock, 128 ) . "<br />";
        }
        
fclose( $sock );
        
$pattern = "|ReferralServer: whois://([^n<:]+)|i";
        
preg_match( $pattern, $text, $out );
        if ( !empty( 
$out[ 1 ] ) )
            return 
whois( $out[ 1 ], $ip );
        else
            return 
'<div class="list1">' . $text . '</div>';
    }
}
require_once(
'../../../includes/Footers.php');
Онлайн: 2
Реклама