-1

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

1 Answers1

0

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.

BladeMight
  • 2,670
  • 2
  • 21
  • 35
  • I use script shortcut links There are ways of paying for visits If 1,000 people come from America, the site pays some money If 1,000 Saudis enter, the site pays a different price I think in this script it is easy to use the idea that I am thinking of. Did you understand what I mean Thank you very much for your response – Ahmed Rizk Oct 20 '18 at 00:36
  • Yes, but the only way to know from what country these people come are by their IP. Mainly all of this does your site hosting, and displays that in your site's statics. Maybe you'll won't even need the `GeoIP` extension if your website hosting supports API that will give you information inside. also see [one](https://stackoverflow.com/questions/3489460/how-to-get-visitors-location-i-e-country-using-geolocation), [two](https://stackoverflow.com/questions/17680413/get-visitors-language-country-code-with-javascript-client-side). – BladeMight Oct 20 '18 at 00:43
  • Yes how will the code format be because I am not a programmer unfortunately How do I implement this idea? Can you help me I have seen these topics, but as I told you I am not a programmer, can I do something? – Ahmed Rizk Oct 20 '18 at 00:53
  • You won't know in which format it would be, since there are many ways to achieve that what are you looking for. Most likely the format will be like you specified in your question, see [this](https://dev.maxmind.com/geoip/legacy/codes/iso3166/). – BladeMight Oct 20 '18 at 00:56