Talcualvip, IP2Location, tiene varios Bin para hacer eso, pero usa SQL para verificar los archivos, la aplicacion es complicada.
El PHP probado:
Código PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
// XSS Protection
function safe ($value){
htmlentities ($value, ENT_QUOTES, 'utf-8')
return $value;
}
$title = $_POST['title'];
$message = $_POST['message'];
print '<h1>' .safe ($title) . '<h1>'
'<p>' .safe ($message) . '<p>';
// Others Security Layout
; Disable allow_url_fopen for security reasons
allow_url_fopen = 'off'
; Lower memory_limit for security reasons
memory_limit = 8M
; Disable register_globals for security reasons
register_globals = 'off'
// Redirection Website
var $idioma = substr ($HTTP_ACCEPT_LANGUAGE, 0, 2);
var iniciales = idioma.substring(0,2);
if(iniciales=="de"){
Header(Location: "http://deu.sitio.net"); //redirigir al sitio en Aleman
}
else if(iniciales=="en"){
Header(Location: "http://eng.sitio.net"); //redirigir al sitio en Ingles
}
else if(iniciales=="fr"){
Header(Location: "http://fra.sitio.net"); //redirigir al sitio en Frances
}
else if(iniciales=="es"){
Header(Location: "http://esp.sitio.net"); //redirigir al sitio en Español
}
else if(iniciales=="it"){
Header(Location: "http://ita.sitio.net"); //redirigir al sitio en Italiano
}
else if(iniciales=="ja"){
Header(Location: "http://jap.sitio.net"); //redirigir al sitio en Japones
}
else Header(Location: "index.html"); //redirigir al sitio internacional
}
?>
</body>
</html>
Segun Netbeans 6.8 for PHP, me salta un error de sintaxis en la linea 48, donde se produce un breakpoint (else Header).
El error:
Parse error: syntax error, unexpected T_RETURN in \\hmfsw02\web02\dtcwin012\audioestudio.net\public_ html\index.php on line 22
Quisiera ponerlo dentro del html, asi queda el index.html, que lea el script y ejecute segun las instancias, si todas las condicionales son falsas, continuar leyendo el archivo mostrandolo al usuario. Porque no me lee en php en el servidor.