简体   繁体   English

通过IP显示国家标志

[英]Display Country Flag by IP

I want to be able to display the Country Flag image by the IP. 我希望能够通过IP显示国家/地区标志图像。 The IPs are stored in Mysql in a column, each page has it's own row with IP like so: IP存储在Mysql的一列中,每个页面都有自己的IP行,如下所示:

TABLE:
PAGEID    INFO    IP
12340     abc     120.120.120.120
12341     fgh     121.121.121.121
12342     ert     122.122.122.122
12343     bvn     120.120.120.120  
12344     hjk     123.123.123.123

So when a user open it will get the IP by the page id from mysql and then decide what country flag to display based on the IP. 因此,当用户打开时,它将通过mysql的页面ID获得IP,然后根据IP确定要显示的国家/地区标志。
Is there such a script like this besides the one below? 除了下面的脚本之外,还有这样的脚本吗?

This is a similar script i found but it's not working: 这是我发现的类似脚本,但无法正常工作:

<IMG SRC="http://api.hostip.info/flag.php?ip=12.215.42.19">
<IMG SRC="http://api.hostip.info/flag.php?ip=<YOUR IP HERE>">

请参阅本文,使用开关盒或其他来回显您的国旗教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM