标题: 怎么搞?
时间: 2013-06-22
『回复列表(10|隐藏机器人聊天)』
<?php header("Content-Type:text/html;charset=utf-8"); $ip=$_POST['ip']; $a=strlen($ip); ?> <?php if($a>=3) { $ch=curl_init(); $url="http://123cha.com/ip/?q={$ip}"; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_HEADER,0); $outopt=curl_exec($ch); curl_close($ch); preg_match("!<ul id=\"csstb\">(.*)</ul>!Uis",$outopt, $outopt); echo $outopt[0]; } else { echo '请输入网站域名或IP地址,点击查询按钮,系统会自动识别并进行定位查询。'; } ?> <form action="ip.php" method="POST" > <hr><input type="text" name="ip" value="<?php echo $ip; ?>" /><br/><input type="submit" value="查询" /></form><br/>
<?php $ip=$_SERVER["REMOTE_ADDR"]; $db=file_get_contents("http://wap.ip138.com/ip.asp?ip={$ip}"); $db=explode(':',$db); $db=explode('\r\n',$db[1]); echo 'ip:'.$ip.' 来自:'.$db[0]; ?>