Check the phpwind code of the previous version:
Unset ($ _ ENV, $ http_env_vars, $ _ Request, $ http_post_vars, $ http_get_vars, $ http_post_files, $ http_cookie_vars );
If (! Get_magic_quotes_gpc ()){
Add_s ($ _ post );
Add_s ($ _ Get );
Add_s ($ _ session); // wrapper of addslashes ()
}
If (! Ini_get ('register _ globals ')){
@ Extract ($ _ files, extr_skip );
}
Foreach ($ _ post as $ _ key =>$ _ value ){
$ _ Key = $ _ post [$ _ key];
}
Foreach ($ _ get as $ _ key => $ _ value ){
$ _ Key = $ _ Get [$ _ key];
}
Using the unique variable mechanism of PHP, the global variables are safely converted into local variables. The parse_income function is also used in phpbiz to implement similar functions. Remember that local security is more secure than global security.
Currently, the solution for version 4.3 is as follows:
Foreach ($ _ post as $ _ key =>$ _ value ){
! Ereg ("^/_", $ _ key )&&! Isset ($ _ key) & $ _ key =$ _ post [$ _ key];
}
Foreach ($ _ get as $ _ key => $ _ value ){
! Ereg ("^/_", $ _ key )&&! Isset ($ _ key) & $ _ key =$ _ Get [$ _ key];
}
Add: Another function is simpler:
Import_request_variables ('pg ');
Solve the problem with one sentence.