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

  • 相关阅读:
    浏览器不兼容原因及解决办法
    VC++ MFC DLL动态链接库编写详解
    Saas是什么?
    用CSS中的Alpha实现渐变
    一种真正意义上的Session劫持[转]
    使用.NET Framework中新的日期时间类型[转]
    Hook、钩子、VC++ 基本概念
    H264
    Windows编程中各种操作文件的方法
    将TCP/IP协议移植到内嵌的弹片机中配合GPRS无线模块开发应用
  • 原文地址:https://www.cnblogs.com/solq/p/2517671.html
Copyright © 2011-2022 走看看