Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 4 of 4
  1. #1
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,138
    DNF$
    49,926
    Bank
    0
    Total DNF$
    49,926
    Donate  

    PHP: regsiter_globals value

    Is there a way to locally change the value of register_globals in your PHP code at runtime? For example, if the webhost has regsiter_globals set to off, but I want it on for my script, how do I set that in the code?

    Is it in one of the SuperGlobals? I cannot find it nor can I find how to do this.

    Thanks in advance from a PHP rookie.

    -Bob
    . . .

  2. #2
    Platinum Lifetime Member
    samscripts's Avatar
    Join Date
    Nov 2002
    Location
    Canterbury, UK
    Posts
    205
    DNF$
    522
    Bank
    0
    Total DNF$
    522
    Donate  
    You can't change it at runtime, but you might be able to set it on a per-directory basis with a .htaccess file.

    I think you'd put something like:

    php_value register_globals 1
    in your .htaccess file

    Read the comments at www.php.net/ini_set for more info,

    An alternative is to use the extract() function on the $_REQUEST variable - eg. extract($_REQUEST). It might do what you need.

    Hope this helps,

    Sam

  3. #3
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,138
    DNF$
    49,926
    Bank
    0
    Total DNF$
    49,926
    Donate  
    Thanks Sam. Guess I should probably go back and do it correctly (i.e. $_POST).

    -Bob
    . . .

  4. #4
    Platinum Lifetime Member
    .com.net.org's Avatar
    Join Date
    Oct 2002
    Posts
    1,976
    DNF$
    1,591
    Bank
    0
    Total DNF$
    1,591
    Donate  
    It's best practice to use $_POST or $_GET instead of just $variable.
    Unlimited Domain Hosting - $20/mo
    Dedicated Server - $99/mo

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
  •  

Domain name forum recommended by Domaining.com