Page 1 of 1

Global Variables

Posted: Mon Jun 07, 2004 3:06 pm
by fernandomaciel
I'm not used to the newest version of PHP, 'cause I haven't been programming for a long time. Now that I'm back I discovered that I cannot use global variables (not sure if that is entirely true). Somebody told me that I can sway that situation. If you can help me out, I'd be really thankful for the project that I'm working with is entirely done with global variables and I'm not too eager to completely change my code.

Thank you all,
Fernnando Maciel

Posted: Mon Jun 07, 2004 3:10 pm
by dull1554
in you php.ini file you can set regester_globals to on but this is default off because its not very secure

Posted: Mon Jun 07, 2004 7:48 pm
by John Cartwright
you can also do it via .htaccess if you do not have access to your php.ini

Posted: Mon Jun 07, 2004 7:53 pm
by evilmonkey
or just use

Code: Select all

$_REQUEST['variable'];

Posted: Mon Jun 07, 2004 11:24 pm
by kettle_drum
It will only take you like 10mins to do a search and replace on all GET/POST/COOKIE/SESSION

Posted: Tue Jun 08, 2004 5:05 am
by Dark-Rival
Well that depends on the number of scripts he has to change then :)