我用的这个CMS系统在模板中直接调用IP的标签是[!--infoip--]
这个模板可以直接用php代码,我试了直接<?phpinfo()?>可以执行。
地址位置小偷代码如下<?
$url='http://ip138.com/ips.asp?ip=[!--infoip--]';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $rg[1],$ip?>
用这段代码,调用不出物理地址来,改为<?
$url='http://ip138.com/ips.asp?ip=[!--infoip--]';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $url?>可以成功输出http://ip138.com/ips.asp?ip=60.191.153.61可见[!--infoip--]在这段php代码中也可以调用。将代码又改为<?
$url='http://ip138.com/ips.asp?ip=60.191.153.61';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $rg[1],$ip?>
放入模板中,也可以得到想要的结果:“本站主数据:浙江省台州市 电信
参考数据一:浙江省台州市 电信
参考数据二:浙江省台州市 电信 ”唯独用标签时,就读不出来了,我这是哪里的问题,请帮忙分析一下,谢谢!
这个模板可以直接用php代码,我试了直接<?phpinfo()?>可以执行。
地址位置小偷代码如下<?
$url='http://ip138.com/ips.asp?ip=[!--infoip--]';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $rg[1],$ip?>
用这段代码,调用不出物理地址来,改为<?
$url='http://ip138.com/ips.asp?ip=[!--infoip--]';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $url?>可以成功输出http://ip138.com/ips.asp?ip=60.191.153.61可见[!--infoip--]在这段php代码中也可以调用。将代码又改为<?
$url='http://ip138.com/ips.asp?ip=60.191.153.61';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $rg[1],$ip?>
放入模板中,也可以得到想要的结果:“本站主数据:浙江省台州市 电信
参考数据一:浙江省台州市 电信
参考数据二:浙江省台州市 电信 ”唯独用标签时,就读不出来了,我这是哪里的问题,请帮忙分析一下,谢谢!
另外,我不知你说的php小偷是什么意思?
“eregi('<ul class="ul1">(.*)</ul>',$file,$rg);”
这一句。程序调取指定url页面中的指定内容,例如'http://ip138.com/ips.asp?ip=60.191.153.61'这个url页面包含这个IP地址的物理地址,我要“偷”的就是只要 指定的 地址位置 这部份内容。“[!--infoip--] 是模板使用的标签,不是php合法的标签! ”这一句我同意,但$url='http://ip138.com/ips.asp?ip=[!--infoip--]';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $url的确能输出 url=http://ip138.com/ips.asp?ip=60.191.153.61 说明[!--infoip--]的值'60.191.153.61 '能够被调用出来
<?
$url='http://ip138.com/ips.asp?ip=[!--infoip--]';
$file=file_get_contents($url);eregi('<ul class="ul1">(.*)</ul>',$file,$rg);echo $url?>
$url 为经过CMS模板解析系统解析,这是值还是 http://ip138.com/ips.asp?ip=[!--infoip--] 而非 http://ip138.com/ips.asp?ip=60.191.153.61 所以不能取得你想要的数据想要实现ip找地理位置的功能,可以去网上下个相应的数据库
$url="http://ip138.com/ips.asp?ip=$IP";