Php > Miscellaneous
Register_globals INI Setting Emulator
Register_globals INI Setting Emulator if(isset($GLOBALS["registerglobalsproxy"])) return; $GLOBALS["registerglobalsproxy"] = true; $oldErrorLevel = error_reporting(0); //**HANDLE_FILE_VARIABLES_SEPARATELY //** loop over the uploaded file array. Files need to be handled differently //** due the the fact that values returned are in an array, where as with //** register globals enabled they are not. foreach($_FILES as $fileVar => $fileArray) { if(is_array($fileArray)) { //** for each uploaded file create a variable for each value in the //** upload array named 'filevarname_uploadedfilevalue'. foreach($fileArray as $fileKey => $fileValue) { if(!is_numeric($fileKey)) { //** construct the name of the variable to create. $newVarName = $fileVar . "_" . $fileKey; //** dynamically set the variable value. $$newVarName = $fileValue; //** the server file path needs to be stored as this fileVar to support //** conventions of old version. if($fileKey == "tmp_name") //** path to uploaded file. $$fileVar = $fileValue; //** store full server path. } } } } //**HANDLE_OTHER_SERVER_VARIABLES* //** arrays of variable storage methods to be parsed, in order of //** increasing trustworthyness. $methodsToParse = array($_GET, $_POST); foreach($methodsToParse as $method) { //** if the method is an array of variables attempt to set each //** associative key to its appropriate value. if(is_array($method)) { foreach($method as $key => $value) { //** do not try to create any variables from indexes of arrays. if(!is_numeric($key)) $$key = $value; } } } //** restore the error reporting when entered. error_reporting($oldErrorLevel); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage