Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/04/2015, 09:23
Avatar de AlexServ
AlexServ
 
Fecha de Ingreso: diciembre-2008
Ubicación: La Paz Bolivia
Mensajes: 97
Antigüedad: 15 años, 4 meses
Puntos: 0
Pregunta Problemas con array_shift explode en PHP 5.4.39

Me sale el error "PHP Strict Standards: Only variables should be passed by reference in contentads.php on line 167" esto ocurre desde que el servidor actualizó la versión de PHP, la linea 167 contiene $ip = array_shift(explode(',',$ip));

le dejo el código para que me puedan ayudar:

Código PHP:
//function from CBreCaptcha
function GetUserIp() {
   
$ip "";
   if(isset(
$_SERVER)) {
       if (!empty(
$_SERVER['HTTP_CLIENT_IP'])) {
         
$ip=$_SERVER['HTTP_CLIENT_IP'];
       } elseif (!empty(
$_SERVER['HTTP_X_FORWARDED_FOR'])) {
         
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
       } else {
         
$ip=$_SERVER['REMOTE_ADDR'];
       }
    } else {
       if ( 
getenv'HTTP_CLIENT_IP' ) ) {
          
$ip getenv'HTTP_CLIENT_IP' );
       } elseif ( 
getenv'HTTP_X_FORWARDED_FOR' ) ) {
          
$ip getenv'HTTP_X_FORWARDED_FOR' );
       } else {
          
$ip getenv'REMOTE_ADDR' );
        }
    }
    
// In some weird cases the ip address returned is repeated twice separated by comma
    
if(strstr($ip,',')){
      
$ip array_shift(explode(',',$ip));
    }
   return 
$ip;
 }

__________________
Noticias Bolivianas - La música es maravillosa Mp3 Bolivia