How can I not get the $ _ REQUEST value when the parameter & quot; c & quot; is included in the url? However, if you replace the parameter with another name, such as uppercase & quot; C & quot;, you can get the value. What is going on?
When the parameter "c" is included in the url, How does $ _ REQUEST fail to get the value?
However, if you replace the parameter with another name, such as uppercase "C", you can get the value.
What is going on?
Reply content:
When the parameter "c" is included in the url, How does $ _ REQUEST fail to get the value?
However, if you replace the parameter with another name, such as uppercase "C", you can get the value.
What is going on?
YesthinkPHP
?thinkPHP
Extracted by defaultGET
Inc
Ascontroller
For scheduling. You canconfig
File replacementVAR_CONTROLLER
To select other parameterscontroller
In this way, the passing of the c parameter will not be blocked.
In the thinkphp framework, the request distribution part needs to parse the m c a parameter. After parsing, the corresponding parameters are deleted from the $ _ GET array.
Path \ to \ ThinkPHP \ Library \ Think. class. php
/*** Initialize the application * @ access public * @ return void */static public function start () {... // run the application App: run ();}
Path \ to \ ThinkPHP \ Library \ Think \ App. class. php
/*** Quick method for running the application instance entry file * @ access public * @ return void */static public function run (){... app: init ();...}
/*** Initialize the application * @ access public * @ return void */static public function init (){... // URL scheduling Dispatcher: dispatch ();...
Path \ to \ ThinkPHP \ Library \ Think \ Dispatcher. class. php
/*** URL ing to Controller * @ access public * @ return void */static public function dispatch (){... // obtain the module name define ('module _ name', defined ('Bind _ module ')? BIND_MODULE: self: getModule ($ varModule ));... // obtain the CONTROLLER namespace (PATH) define ('controller _ path', self: getSpace ($ varAddon, $ urlCase )); // get the CONTROLLER and operation NAME define ('controller _ name', defined ('Bind _ controller ')? BIND_CONTROLLER: self: getController ($ varController, $ urlCase); define ('Action _ name', defined ('Bind _ Action ')? BIND_ACTION: self: getAction ($ varAction, $ urlCase ));...
/*** Get the actual controller name */static private function getController ($ var, $ urlCase) {... $ controller = (! Empty ($ _ GET [$ var])? $ _ GET [$ var]: C ('default _ controller'); unset ($ _ GET [$ var]);...}
The code for obtaining the module is similar to that for operating the method.
In fact, we should not directly retrieve data from $ _ GET because if we use the URL mode of pathinfo or the URL mode of rewrite, these parameters are not in $ _ GET.
How is your post?