24-02-2010, 01:21 AM
Héhé, quoi qu'il en soit si vous voulez que votre projet soit cross-register_globals voici le code de php.net:
Code PHP :
<?php
// Unregister_globals: unsets all global variables set from a superglobal array
// --------------------
// This is useful if you don't know the configuration of PHP on the server the application
// will be run
// Place this in the first lines of all of your scripts
// Don't forget that the register_global of $_SESSION is done after session_start() so after
// each session_start() put a unregister_globals('_SESSION');
function unregister_globals()
{
if (!ini_get('register_globals'))
{
return false;
}
foreach (func_get_args() as $name)
{
foreach ($GLOBALS[$name] as $key=>$value)
{
if (isset($GLOBALS[$key]))
unset($GLOBALS[$key]);
}
}
}
unregister_globals('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
Reste à mettre unregister_globals('_SESSION'); après session_start().