Ver Mensaje Individual
  #16 (permalink)  
Antiguo 29/08/2006, 08:52
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Esta funcion me ha servido a mi para "emular" el globals off, espero te sirva:
Código PHP:
function unregister_GLOBALS()
{
   if (!
ini_get('register_globals')) {
       return;
   }

   
// Might want to change this perhaps to a nicer error
   
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
       die(
'GLOBALS overwrite attempt detected');
   }

   
// Variables that shouldn't be unset
   
$noUnset = array('GLOBALS',  '_GET',
                    
'_POST',    '_COOKIE',
                    
'_REQUEST''_SERVER',
                    
'_ENV',     '_FILES');

   
$input array_merge($_GET,    $_POST,
                        
$_COOKIE$_SERVER,
                        
$_ENV,    $_FILES,
                        isset(
$_SESSION) && is_array($_SESSION) ? $_SESSION : array());
   
   foreach (
$input as $k => $v) {
       if (!
in_array($k$noUnset) && isset($GLOBALS[$k])) {
           unset(
$GLOBALS[$k]);
       }
   }
}

unregister_GLOBALS(); 
Si le agrega un poco de mas lentitud a tu codigo por deshacer lo que php hizo al inicio, pero sirve cuando el hosting no puede cambiar los valores. Saludos!