简体   繁体   中英

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.

For php there is GeoIP extension, which would help you find the country. And then you would be able to check if that is the needed county and execute your desired code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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