On Sun, 7 Jul 2002, Greg Donald wrote:
> On Sun, 7 Jul 2002, Miguel Cruz wrote:
>>> <?
>>> if(ini_set("register_globals", "0"))
>>>   echo "ini_set success";
>>> else
>>>   echo "ini_set failed";
>>> ?>
>>
>> Please don't say "this code doesn't work." Say why you think it didn't 
>> work, whether that's because you received an error message, or a 
>> specific 
> 
> Uhh.. I don't have any thoughts as to why it doesn't work, that's why I 
> posted.  The function itself appears broken, my code is a test to that 
> notion. 

I can see where my wording was ambiguous. By "why you think it didn't
work", I don't mean "the explanation for its failure to function", but
rather "the experience you had that convinced you it was not working".

Obviously something happened to make you decide that it wasn't working. We 
need to know what that was. Maybe it was an error message. Maybe it was a 
plume of smoke rising from your computer. Maybe it was some sort of weird 
behavior of your program. It's just a general thing: We can't read your 
mind. Or at least I can't.

> If you can't be helpful then feel free to shutup..

Well, I did go on to answer your question. It could've been worse.

>>> So does anyone know why my code doesn't work then?  ini_set() seems 
>>> broken.  Can anyone confirm or deny?
>>
>> I believe the issue here is that by the time your PHP code starts
>> executing and gets to the ini_set call, it's too late to register the
> 
> "gets to the ini_set call" - what do you mean?  The code I posted is all 
> there is to the entire script.  Where else would I use the ini_set() 
> function except at the very beginning of a script?

Before your code starts, there is a whole bunch of initialization that
takes place in the script engine. It looks at its settings to see how it
should behave. It gathers all the data that came from the web server
(details about the user's request, etc.). It learns about its environment.
It populates global variables.

Having done these, it starts looking at your code. By this time it's too
late to change the way those prior steps were taken. It's like waiting
until the plane has taken off (i.e., execution of your code has begun) and
then telling the flight attendant you wished it were headed to Chicago
instead of Detroit.

miguel


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

Reply via email to