【发布时间】:2013-05-03 09:15:56
【问题描述】:
我有一个脚本,它使用 api 来获取 IP 地址的 IP 信息。当访问者输入时,它只显示有关访问者 ip 的默认信息,但我想制作一个表单,以便访问者可以通过在表单中输入 IP 来查找特定的 IP 地址 并点击查找。
我不知道怎么做,我需要你的帮助,谢谢你
index.php
<?php
require_once('ipapi.class.php');
$ip = $_REQUEST['REMOTE_ADDR']; // the IP address to query
$query = IPAPI::query("$rip");
echo "\t IP Information: " .$rip. "<br />";
echo "\t ISP: " .$query->isp . "<br />";
echo "\t Organization: " .$query->org . "<br />";
echo "\t City: " .$query->city . "<br />";
echo "\t Region: " .$query->regionName . "<br />";
echo "\t Country: " .$query->country . "<br />";
?>
【问题讨论】:
-
抱歉我没听懂!!?
-
远程地址是$ip,但是你查询$rip,它也不应该用引号引起来,所以我假设它默认为本地
-
是的,你说得对,但它工作得很好,我只需要表格,这样访客就可以录制他想要的 ip 并获取信息,对不起,我的英语很差:P,我希望你知道我是什么想说:)