This article describes how to add variable error Requestvarnotallow in DedeCMS! This article provides a method to modify the php file, but it cannot be solved, for more information about how to add a variable in DedeCMS, see the following article: Request var not allow! This article provides a method to modify the php file, but it cannot be solved, if you want to add a new variable in the background, you can refer to the forum where many people have reported that "Request var not allow! "BUG error. This article mainly describes how to solve this problem! The following describes the specific operations:
Open the include/common. inc. php file in the DEDE root directory and find the following content:
The code is as follows:
// Check and register the variable function CheckRequest (& $ val) submitted externally {if (is_array ($ val) {foreach ($ val as $ _ k => $ _ v) {CheckRequest ($ _ k); CheckRequest ($ val [$ _ k]) ;}} else {if (strlen ($ val)> 0 & preg_match ('# ^ (cfg _ | GLOBALS) #', $ val) {exit ('request var not allow! ');}}}
Replace the preceding content with the following:
// Check and register the variable function CheckRequest (& $ val) submitted externally {if (is_array ($ val) {foreach ($ val as $ _ k => $ _ v) {if ($ _ k = 'varname') continue; CheckRequest ($ _ k); CheckRequest ($ val [$ _ k]);} else {if (strlen ($ val)> 0 & preg_match ('# ^ (cfg _ | GLOBALS) #', $ val) {exit ('request var not allow! ');}}}
Dedecms Template: www.php1.cn/xiazai/code/dedecms
Save the changes and try to add new variables in the background.
The preceding error is returned when the variable "Request var not allow" is added to DedeCMS! Solution details of the instance analysis, please pay attention to other related articles in the first PHP community!