Welcome our webmaster and SEO forum
Please enjoy the forum, contribute what you can, and wind up the Moderators!
Closed Thread
Results 1 to 2 of 2

Thread: Turning off register_globals

  1. #1
    ovi Guest

    Default Turning off register_globals

    As I have been learning the ins and outs of PHP, I have come across some cool tricks that you can do when you are running PHP on Apache (as most of you are, I bet). In a hosted environment, one does not usually have access to the PHP.ini file. Oftentimes the default settings are not appropriate for what you are doing, so we need a way to change those settings for your application. Here is where Apache steps in.

    Using the .htaccess file, you can set values for the PHP engine to use at runtime. It is really quite simple to do. The following is the format:

    Code:
    # in Apache files, pound-signs ("#") comment out a line...
    
    # to set a boolean value
    php_flag setting_name on|off
    
    # to set any other values
    php_value setting_name setting_value
    The most common thing that I set is the register_globals flag. When register_globals is on, all variables from the query string (GET), all variables from forms (POST), and (I'm pretty sure) all variables from cookies are automatically available as local variables. That is, if you have a query string like "index.php?fuseaction=home.main&foo=bar&stan=c ox", in the PHP page, you can access them as $fuseaction ("home.main"), $foo ("bar"), and $stan ("cox"), if register_globals is turned on. That may be just fine for your purposes, and it certainly can make your coding easier.

    However, I think it is a little sketchy to allow users to directly affect variables in your script, so I ALWAYS turn it off. Like so:

    Code:
    php_flag register_globals off
    Ovi

  2. #2
    Duke Guest

    Default

    I'm just curious but doesn't disabling this feature make it impossible to link to a certain topic within a forum because the url's are now all the same or am I just misunderstanding the message?

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Brits turning into computer buffs
    By temi in forum General Webmaster Talk
    Replies: 0
    Last Post: 09-25-2004, 01:19 AM
  2. UK turning into nation of gamers
    By temi in forum Computer and Video Games
    Replies: 0
    Last Post: 09-22-2004, 06:12 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124