PHP4 - PHP5 Problems

Out of context: Reply #13

  • Started
  • Last post
  • 15 Responses
  • enobrev0

    it's recommended to keep register_globals off no matter what, although safe_mode is another layter of proection (which tends get in the way more than anything, imo).

    unfit's function is a good way to translate the superglobals ($_GETs and $_POSTs) to local variables. To shorten it, you could use the loop once with the little known $_REQUEST superglobal ,which is both $_GET and $_POST arrays all in one.

    It's probably best to just get the hang of using the superglobals themselves. In the long run it makes your code easier to read and maintain.

    So when you're looking at a page of code, every time you see $_GET['var'], you KNOW it's looking at the url for it's variables. When you see $_POST vars you KNOW they are meant to be from a form. As your scripts grow, these littel hints can be really helpful for debugging and understanding.

    Good luck!

View thread