zoukankan      html  css  js  c++  java
  • whois 域名查询系统

    <?php
    
    /*
     * 域名查询系统:扒万网的
     *	post 方式比较快。。。万网主页使用的
     * 	get 方式不稳定.....
     * */
    
    //!empty($_GET['domain']) && whois(trim($_GET['domain']));
    if(empty($_GET['domain']))
    	outJsonpStream(array("statu"=>0),false);
    	
    	
    $data = array  
    (  
        'domain' => trim($_GET['domain'])
    );
      
    $data= postWhois('http://pandavip.www.net.cn/check/check_ac1.cgi', $data); 
    $_ar=explode("|", $data);
    /*
     * return 211 有注册
     * 			210 无注册
     * */
    outJsonpStream(array("statu"=>$_ar[2]),false);
    
    function getWhois($domain)
    {
        //http://whois.hichina.com/        
        //$cha = 'http://whois.hichina.com/whois/domain/'.$domain;
        //$cha='http://whois.hichina.com/whois/api_webinfo?host='.$domain ; //找到公司注册信息
    
        $cha='http://whois.hichina.com/whois/api_webinfo?host='.$domain ;    
    
        $fp=  file_get_contents($cha,'rb');
        outJsonpStream($fp);
    }
    
    function postWhois($url, $post = null)  
    {  
        $context = array();  
      
        if (is_array($post))  
        {  
            ksort($post);  
      
            $context['http'] = array  
            (  
                'method' => 'POST',  
                'content' => http_build_query($post, '', '&'),  
            );  
        }
      
        return  file_get_contents($url, false, stream_context_create($context)); 
        //outJsonpStream($fp); 
    }  
    
    function outJsonpStream($data,$isJson=true)
    {
    	$callback = $_REQUEST['callback'];
    	if ($callback) {
    	    header('Content-Type: text/javascript');
    	    $json=!$isJson?$callback . '(' . json_encode($data) . ');': $callback . '(' .$data . ');';	    
    	} else {
    	    //header('Content-Type: application/x-json');
    	    $json=!$isJson?json_encode($data):$data;	
    	}
    	echo $json;
    	exit;
    }
    ?>
    

      

    whois 域名查询系统

    编写:solq
    blog:cnblogs.com/solq

  • 相关阅读:
    [学习笔记&教程] 信号, 集合, 多项式, 以及各种卷积性变换 (FFT,NTT,FWT,FMT)
    [学习笔记] CDQ分治&整体二分
    [日常] NOIp 2018 滚粗记
    [学习笔记] 模拟退火 (Simulated Annealing)
    [日常] NOIWC 2018爆零记
    [日常] PKUWC 2018爆零记
    [日常] 最近的一些破事w...
    [BZOJ 1877][SDOI2009]晨跑
    [COGS 2583]南极科考旅行
    [日常] NOIP 2017滚粗记
  • 原文地址:https://www.cnblogs.com/solq/p/2517671.html
Copyright © 2011-2022 走看看