<?
if ($_SERVER) {
if ( $_SERVER[HTTP_X_FORWARDED_FOR] ) {
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} elseif ( $_SERVER["HTTP_CLIENT_IP"] ) {
$realip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$realip = $_SERVER["REMOTE_ADDR"];
}
} else {
if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
$realip = getenv( 'HTTP_X_FORWARDED_FOR' );
} elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {
$realip = getenv( 'HTTP_CLIENT_IP' );
} else {
$realip = getenv( 'REMOTE_ADDR' );
}
}
$nombre_host = $realip;
//echo $nombre_host."--";
$ruta = "";
if (trim($nombre_host) == "201.99.129.15") 
 $ruta = '192.168.1.3';
else{
 if (trim($nombre_host) == "177.234.8.158" || trim($nombre_host) == "127.0.0.1" || trim($nombre_host) == "10.0.0.20")	
 $ruta = '192.168.1.4';
 else
  $ruta = '201.99.129.15';
}
?>
<html>
                        <head>
                        <title>:: DIF ::</title>
                        <META HTTP-EQUIV="refresh" content="0;url=http://<? echo $ruta;?>:81/padron/index.php"> 
                        </head>
                        <body>
                        <p align="center"><font size="5">DIF Quintana Roo, Bienvenidos</font></p>
                        </body>
</html>
