|
|
Posted by Jerry Stuckle on 06/18/36 12:00
Kurda Yon wrote:
> On Jan 15, 8:30 pm, thib´ <th...@coralsnake-team.com> wrote:
>> Kurda Yon wrote:
>>> But I am not sure that I correctly understand the suggested solution
>>> of the problem. I should replace all global variables which I care
>>> about by "normal variables"? I.e. $varname = global-array[$varname].
>>> Why I cannot use the global variables directly?
>> Yes, the subject has been discussed here recently. I'll past the classic
>> example for you to understand quickly:
>>
>> ..
>> if( isset($admin) ) {
>> ..}
>>
>> ..
>>
>> Now:http://mysite.net/myscript.php?admin=1
>> Here we go.
>>
> Is $admin a global variable? I thought that it can be global only
> after "global $admin;"-line in the code. Am I wrong? Any variable
> which is given to the php-script via the address line will
> automatically become global (if register_global is "on")?
>
>
>> Thus, globals aren't registered automatically anymore, you have to do it
>> yourself: $registered_global = $_SESSION['unregistered_global'];
>>
> I think I have some problems with the terminology. The above example I
> would describe as follow. We have assign to a "normal" variable
> ($registered_global), a value taken from a session variable
> ($_SESSION). But you replace "normal" by "global" and "assignment" by
> the "registration". Do you consider any "assignment" as the
> "registration" or only those "assignment" is a "registration" in which
> the value was taken from the $_SESSION?
>
No - register_globals has nothing to do with variables you specify as
global yourself.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|