RE: re[PHP] gister_globals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: tbt [mailto:nadeeshan2@xxxxxxxxx]
> Sent: Wednesday, January 16, 2008 3:22 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  re[PHP] gister_globals
> 
> 
> Hi,
> 
> I'm a newbie to php and i would like to set register_globals to 'on'
> from my
> php script itself(eg:- index.php). Is there any way of doing this.
> 
> Thanks
> --
> View this message in context: http://www.nabble.com/register_globals-
> tp14868899p14868899.html
> Sent from the PHP - General mailing list archive at Nabble.com.
> 

If your web server is Apache you can create a file named .htaccess and place
it in the document root. Then set up the PHP configuration like this:

# This is just for commenting / you can comment out settings you don't want
to apply
# Switch on or off and configure as you desire
php_flag short_open_tag on
php_flag register_globals off
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag magic_quotes_sybase off
php_flag display_errors on
php_value error_reporting 2039
php_value max_execution_time 300

If your system is not apache or it doesn't support .htaccess files, then you
are doomed about register_globals, when your script is run, it is too late
for enabling it (but you can deal with other .ini settings using
http://php.net/ini_set)

The most you can do for register_globals is using extract on $_GET, $_POST
and $_COOKIE at the very top (I wouldn't even enable register_globals
but...) http://php.net/manual/en/function.extract.php or using a loop to
populate $_GLOBALS with the $_GET, $_POST and $_COOKIE keys/values.

Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: info@xxxxxxxxxxxxx  | MSN Chat: best@xxxxxxxxxxxxx  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux