设置首页  |   加入收藏  |  联系我们   
您的位置: 主页>程序设计>PHP>正文
PHP IPwhois类
文章来源:  编辑:  发布时间:2007-11-27

原来写的IPwhois类

 <?php
/*
*
* Class : IP Whois Verson 1.0
* Info : Get IP's information form 4 whois server
* Author : PhpUp Studio
* Date : 12/12/2004
* www.knowsky.com
*
*/
class IPWhois
{
        var $server = 'whois.arin.net';
        var $target;
        var $timeout = 10;
        var $msg;
       
        function IPWhois($target)
        {
                $this->target = $target;       
        }
        function ShowInfo()
        {
                if($this->_CheckIP($this->target))
                {
                        $this->msg = $this->_GetInfo($this->server);
                        if($this->_CheckInfo($this->msg))
                        {
                                $this->msg = $this->_GetInfo($this->server);
                        }
                }
                else $this->msg = '<p>Please Enter An IP Address<br></p>';
               
                return $this->msg;       
        }
        function _CheckIP($temptarget)
        {
                if(eregi("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}", $temptarget))
                {
                        $f = 1;
                        $detail = explode(".",$temptarget);
                        foreach($detail as $v)
                        {
                                if($v > 255 || $v < 0)
                                {
                                        $f = 0;
                                        break;       
                                }       
                        }
                }

 
Tags: this-msg if var function temptarget target IP IPWhois

Google
 
上一篇: php用流方式制作缩略图   下一篇: 用PHP读写NTFS文件系统下的文件摘要信息
【返回顶部】 【打印】 【大】 【中】 【小】 【关闭】

 我来说两句
用户名: 新注册) 密码: 匿名评论 [论坛讨论]
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 相关文章
 热门文章

 
版权所有  2005-2006  Linux集中营  闽ICP备07500055号