Hi all.

I have recently moved my site to a dedicated server which we have total control.

The old hosting company were running PHP 4.1.x. The PHP.INI file was set with register_globals = NO.

In PHP 5.x register_globals is by default set OFF.

This has stop some but not all of my scrots from working.

I thnk my questionis, am I safe to turn ON register_globals.

    I thnk my questionis, am I safe to turn ON register_globals.

    Maybe, only an inspection of your code can prove that.

    If possible, I suggest that you take the time to get rid of the reliance on register_globals.

      Hi LaserLight,

      Many thanks for your reply.

      With "register_globals" set to OFF, does this mean that if I use "print_r $_SESSION(); the script will on show any output.

      Because thats whats happening.

        With "register_globals" set to OFF, does this mean that if I use "print_r $SESSION(); the script will on show any output.


        I think you have a typographical error since "the script will on show any output" does not make sense. If you have session variables registered, print_r($
        SESSION) will show them.

          register_globals does not affect $SESSION. Or $POST, $GET, $SERVER, or $_ENV. Those variables are what you should be using instead of turning register_globals on.

          laserlight wrote:

          I think you have a typographical error since "the script will on show any output" does not make sense.

          At least he's being consistent. If he hadn't done that I'd never have understood the issue when he said

          dcjones wrote:

          The PHP.INI file was set with register_globals = NO. In PHP 5.x register_globals is by default set OFF.

          So, what's the difference?

          laserlight wrote:

          If possible, I suggest that you take the time to get rid of the reliance on register_globals.

          register_globals is gone in PHP 6; after being deprecated a few years ago, the intervening time was provided as an opportunity for developers to migrate away from its use before its removal broke their programs.

            Write a Reply...