Reply to Re: "register_globals off" and "session side-effect"

Your name:

Reply:


Posted by Kurda Yon on 07/18/91 12:00

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?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация