$referer=$_SERVER['HTTP_REFERER']; $pais=$HTTP_COOKIE_VARS["pais"]; $web1="http://www.tesacom.com.ar/index.htm"; $web2="http://www.tesacom.com.br/"; $web3="http://www.tesacom.cl/index.htm"; $web4="http://www.tesacom.com.py/index.htm"; $web5="http://www.tesacom.com.uy/index.htm"; if( !strlen($id)) { $res= strcasecmp($referer, $web1); if ($res==0) { //argentina setcookie("pais","ARG"); header("Location: home.php"); exit; } $res= strcasecmp($referer, $web2 ); if ($res==0) { //brasil setcookie("pais","BRA"); header("Location:".$web2); exit; } $res= strcasecmp($referer, $web3 ); if ($res==0) { //chile setcookie("pais","CHI"); header("Location: home.php"); exit; } $res= strcasecmp($referer, $web4 ); if ($res==0) { //paraguay setcookie("pais","PAR"); header("Location: home.php"); exit; } $res= strcasecmp($referer, $web5 ); if ($res==0) { //uruguay setcookie("pais","URU"); header("Location: home.php"); exit; } } else{ setcookie("pais",$id); if($id == 'BRA') header("Location:".$web2); else header("Location: home.php"); exit; } ?>
![]() |
|||||||||||