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

  • 相关阅读:
    windowsCE常用编译参数 及编译器列表
    摘抄System Architecture for Native Device Drivers
    django+vue学习系列
    FreeTextBox的ToolbarButton整理
    FreeTextBox实现机制
    Server的Transfer和Response的Redirect
    FTB2.0和CuteEditor的一些问题
    ASP.NET跨应用程序进行登录的解决
    testFTB2.0
    Rainbow分页解决方案
  • 原文地址:https://www.cnblogs.com/solq/p/2517671.html
Copyright © 2011-2022 走看看