Powered by InterCreatives | Site Map
Search:
NewSourceMedia Popular Tutorials: PHP Javascripts Web Hosting
SoftwareTutorials
CATEGORIES
Job Listings
 
Home / PHP /

Register_Globals workaround for config on or off


Option 1 - PHP Config File:
First place to look is to open up the php config file on your root server and find the line register_globals and set it to "on" or "off". Some may want you to set it to "0" or "1".

Option 2 - php.ini File:
If you do not have access to your php config file (most people using shared servers will not have access), you may be able to us a "php.ini" file on any public directory (like under /public_html/). There you will be able to set register_globals on or off to that directory, including all sub-directories. Once you've created the file using the name "php.ini" just type "register_globals = on" in the file and upload that to your server.

Option 3 - .htaccess File:
If the above does not work, just use the .htaccess file and type the following:

#Turn off register_globals
php_value register_globals 0

or

#Turn on register globals
php_value register_globals 1

If all else fails, just do this at the begining of your code:

while(list($k,$v)=each($_POST)){
$$k=$v; //Yes, that's two dollar signs
}

This will set all post data (if you want to use $_GET, just subsatute $_POST to $_GET) as a variable so your code now can read all the data passed to it via Post or Get.

That's it.


Next PHP Page:
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] 





Hosting by iPowerWeb.com - 50 Gb for $7.95