English 中文(简体)
php 目的地
原标题:php ip location

I have a simple question. Is it possible to redirect people in my website by the IP location?

Example: one person navigates on the site and when go to pay, if the ip location is from Portugal pay by bank transfer, if not pay by paypal?

sorry my english. thanks, Pedro Lopes

问题回答

最后,它像你一样,只是真心实意地关注把他们送往哪一个计票平台。 允许用户从你们所支持的国家名单中挑选本国,这非常容易和可靠。 这既比基于IP的解决办法更准确,也解决了可能不在家用电脑的旅客。 link @Piskvor在上述评论中提供。

For the example you gave, you could offer your standard billing address form. If the user selects a country other than Portugal, the bank transfer tender type gets disabled, and PayPal is selected.

当然,你可以这样做。 但我这样做并不准确。

例如,我来自希腊科孚。 我的地理位置总是在希腊雅典。

Another example. I have try to lock out a whole country from accessing my web site for a personal reason. But while that work good, is not perfect, still I have visits from that country.

是的。 完全有可能根据来访者IP-Location进行跟踪和转播。

您可使用ipgeoposition.io AP。 每月最多可使用30K项申请(每天1K项申请)。 有许多语文,如公共卫生和社会福利部、 Java等。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签