<?php
//session_start();
//$_SESSION['testlogged'] = true;

// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
#header("Location: http://www.lingotip.com/translate/main.php");
//echo "1"; exit;

/*
if (!$_SESSION['geo_country']) {
      require_once("translate/includes/geoip.inc.php");
        $geoip_file = $_SERVER['DOCUMENT_ROOT']."/geo/GeoIP.dat";
        $gi = geoip_open($geoip_file,GEOIP_STANDARD);
        $_SESSION['geo_country'] = geoip_country_name_by_addr($gi, $_SERVER['REMOTE_ADDR']);
        geoip_close($gi);
}
*/

$country_arr = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR']));
//echo $country_arr['geoplugin_countryName'];exit;

//if ($_SESSION['geo_country'] == "Israel")
if ($country_arr['geoplugin_countryName'] == "Israel")
	header("Location: http://www.lingotip.com/translate/he_IL/best-quality");
else
	header("Location: http://www.lingotip.com/translate");

?>
