<?php
//下载ip库,和php解析代码类库 http://www.ipip.net/free_download/
//error_reporting(0);
header('Content-Type: text/html; charset=UTF-8');
require ('IP.class.php');
$ip = new IP();
$area=$ip->find('www.pi.com');
//print_r($area); //
//$area[0]='中国'; $area[1]='山东',$area[2]='青岛';
switch ($area[2])
{
case '青岛':
header('location: http://sd.pi.com');break;
case '西安':
header('location: http://xa.pi.com');break;
default:
//print($area[2]);
}