Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/04/2012, 06:24
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: Error en archivo php para geolocalización

ELSE IF Y ELSEIF son iguales solamente cuando se están usando las llaves sin cortar el codigo,para que no te de error haciéndolo del modo que lo estas haciendo tienes que unir ELSEIF en la linea 25.

O sea tu codigo funcionaria de esta manera con else if separado.

Código PHP:
Ver original
  1. $IP = $_SERVER["REMOTE_ADDR"];
  2.  
  3. include("geo/geoip.inc");
  4.  
  5. $gi = geoip_open("geo/GeoIP.dat", GEOIP_MEMORY_CACHE);
  6.  
  7. $CountryCode = geoip_country_code_by_addr($gi, $IP);
  8. geoip_close($gi);
  9.  
  10.  
  11. if ($CountryCode=="ES"){
  12.  header('Location: http://track.adjal.com/aff_c?offer_id=1396&aff_id=6636');
  13. }
  14. else if($CountryCode=="AR"){
  15. header('Location: http://track.adjal.com/aff_c?offer_id=1654&aff_id=6636');
  16. }
  17. else {
  18.  header('Location: http://track.adjal.com/aff_c?offer_id=1654&aff_id=6636');
  19. }

Observacion: no veo por que tienes que hacer corte del codigo, total todo lo que vi fue php.

Saludos.