Re: php5 and global variables

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

 



IME, no need to edit .htaccess.

Do you have a file which at the top of every file? Like config.php, which 
will included by the other files? If yes, use this line on the top of that 
file:

import_request_variables("gpc", "");

If you don;t have that file, place that file which you need register globals 
on, on there.

This function will convert $_GET['var'], $_POST['var'], $_COOKIE['var'] into 
$var, and other varibles to that schema.  From PHP manual: Note that the 
order of the letters matters, as when using "gp", the POST variables will 
overwrite GET variables with the same name. Any other letters than GPC are 
discarded

Hope this help. But, what Krishna wrote is very helpfull for the future 
projects :). Register globals on (or modification with that function) is 
have security risk.

LuckyGuy354
IT Beginner

http://www.wiwid.org

----- Original Message ----- 
From: "Tarun" <tarun.virgo@xxxxxxxxx>
To: <php-objects@xxxxxxxxxxxxxxx>
Sent: Tuesday, March 25, 2008 9:46 PM
Subject:  php5 and global variables


> hello Friends,
>
> How to set global variables " ON" in php 5 in .htaccess file.
>
> in php4 we could set it by using the following line.
>
> <IfModule mod_php4.c>
>  php_value session.use_trans_sid 0
>  php_value register_globals 1
> </IfModule>
>
> but what to do for php5 to use global variables, and updating htaccess.
>
> Please suggest me
>
> Warm Regards,
>
> Tarun


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux