liyao20060101 发表于 2017-3-25 13:15:25

php 根据网址获ip

<?php
if(isset($_GET['url'])){
$myWebSite = ($_GET['url']);
$ip = gethostbyname($myWebSite);
$result = '<?xml version="1.0" encoding="gb2312"?>
<xml><item><domain>'.$myWebSite.'</domain><IP>'.$ip.'</IP></item></xml>';
echo $result;
}else{
echo"输入网站域名订阅域名对应IP";
echo"<form action='' method='get'>";
echo "域名 : <input name='url' value=''>";
echo"<input type='submit' name='Submit' value='订阅'>";
echo"</form>";
}
?>
 
页: [1]
查看完整版本: php 根据网址获ip