Announcement

Collapse
No announcement yet.

register_globals?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • register_globals?

    Apparantly my scripts rely heavily on this being set to "on." I learned that future builds of php will not have this option, so I need to learn how not to rely on this feature.

    What do I look out for when I'm coding to avoid relying on register_globals being on?
    Pluh.com (random nonsense) - Psychostick.com (my stupid band) - Collectiveunderground.com (AZ local music site) - Evacuatechicago.com

  • #2
    Use super globals ($_POST, $_GET, $_REQUEST).

    Comment


    • #3
      Let's assume I've never used super globals before (because I haven't ), could you (or someone else) provide a quick example of super_globals as opposed to regular globals?
      Pluh.com (random nonsense) - Psychostick.com (my stupid band) - Collectiveunderground.com (AZ local music site) - Evacuatechicago.com

      Comment


      • #4
        If you request something via URI ->

        page.php?variable=value

        It gets assigned to $_GET['variable'] first. register_globals will then go through $_GET and register each variable into $variable.


        POST requests -> $_POST.

        If you dont want to learn how to use globals, you could just write a function that registers them

        Comment


        • #5
          I would suggest using them though. They have the advantage of being super globals so they are accessible in any functions or classes.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X