|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
||||
|
||||
|
Setting Register Globals to on
Hey i have come across this code, it claims to be able to set register globals or any other variable in the php.ini file, if you dont have access to the php.ini file.
ini_set('register_globals', 'on'); Anyone know the advantages/dis-advantages to using this? |
|
#2
|
|||
|
|||
|
RE: Setting Register Globals to on
it doesn't always work.
don't rely on it. |
|
#3
|
||||
|
||||
|
RE: Setting Register Globals to on
i know it doesnt but does anyone actually know in what situations it doesnt?
|
|
#4
|
|||
|
|||
|
RE: Setting Register Globals to on
It doesnt work when PHP is set up for scripts to not control environment variables.
|
|
#5
|
|||
|
|||
|
RE: Setting Register Globals to on
it doesn't work, period.
(doesn't work as in NEVER). |
|
#6
|
|||
|
|||
|
Happy Birthday xs0
Quote:
Zombie, I am not sure I understand what you are saying, could you be a little clearer. |
|
#7
|
||||
|
||||
|
RE: RE: Setting Register Globals to on
Quote:
It does! I've succesfully used ini_set() many times. Not for register_globals but other environment variables. |
|
#8
|
|||
|
|||
|
RE: Setting Register Globals to on
I think what zombie is trying to say is that register_globals cant be turned on by ini_set() Not necessarily others.
|
|
#9
|
||||
|
||||
|
RE: Setting Register Globals to on
ok ini_set() is still a good function even if it cant change register gobals. I think it can only change enviromental variables which are set to either 1 or 0 not on or off.
|
|
#10
|
||||
|
||||
|
RE: Setting Register Globals to on
AFAIK it can set any environment variables. And 1 & 0 is the same as true & false which is the same as on and off. But others work too. I once played around with the highlight string colors and my script used ini_set() to do it. And color codes aren't just 1 and 0.
|
|
#11
|
||||
|
||||
|
RE: Setting Register Globals to on
The reason i came to my above conclusion was that i have seen many examples of ini_set() but all of them use 1 and 0 so i assumed they wherent like true/false and on/off thanks for informing me they are the same.
|
|
#12
|
|||
|
|||
|
RE: Setting Register Globals to on
of course i was saying that ini_set() doesn't work for register globals. if it didn't work at all, why would that function even exist?
and if you think about it, it is quite logical that it doesn't work. global variables are populated by php interpreter before your script is run, so before you can call ini_set(). it doesn't work for any setting that affects things that are done before your script is run. like maximum upload file size, and similar.. Quote:
i know you are joking, but you see that i did need to explain evem more |
|
#13
|
|||
|
|||
|
RE: Setting Register Globals to on
There is a list of stuff that ini_set can change on the manual www.php.net/ini_set
|
|
#14
|
||||
|
||||
|
RE: Setting Register Globals to on
I use ini set to specify sessions dont use cookies on my site. And its quite handy for that.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Setting Register Globals to on |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|