【发布时间】:2015-10-05 18:04:00
【问题描述】:
我是 geoplugin.class,用于将 CA 用户重定向到特定链接。
现在代码只允许我将用户重定向到 1 个网站。我想修改此代码,以便可以将用户重定向到任一
link1.com
link2.com
link3.com
有人对此有快速修改吗?
提前谢谢你。
<?php
require_once('geoplugin.class.php');
$geoplugin = new geoPlugin();
$geoplugin->locate();
$geo_region = $geoplugin->region;
switch($geo_region) {
case 'CA':
header('Location: http://www.link1.com');
exit;
default: // exceptions
header('Location: http://www.everyoneelsegoeshere.com');
exit;
}
?>
【问题讨论】:
标签: php geolocation