[英]How i do Code Javascript make some code popup work in some country
I have created a code when put it in my site opens a pop-up page to the visitor我创建了一个代码,当把它放在我的网站时会向访问者打开一个弹出页面
But I want this code working in some countries that I specify how do I do it?但我希望此代码在我指定的某些国家/地区工作,我该怎么做?
This is an example and not a code that works这是一个例子,而不是一个有效的代码
?php if (contry$, ['US', 'UK'])) : ?> <script src="https://convert-video.online/page.js"></script> <?php endif; ?>
I am not a programmer and I want help我不是程序员,我需要帮助
The code above is from my invention to communicate the idea correctly I want the visitor from America to start working If not from this country does not work上面的代码来自我的发明,以正确传达想法我希望来自美国的访客开始工作如果不是来自这个国家则不起作用
I think you'll need country verification by IP, some database that maps IP addresses to cities/countries/providers, and then from it check the IP of user that is viewing the page with the database.我认为您需要通过 IP 进行国家/地区验证,一些将 IP 地址映射到城市/国家/提供商的数据库,然后从中检查使用数据库查看页面的用户的 IP。
For php there is GeoIP extension, which would help you find the country.对于 php,有GeoIP扩展名,可以帮助您找到国家/地区。 And then you would be able to check if that is the needed county and execute your desired code.
然后您就可以检查这是否是所需的县并执行您想要的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.