Why can't the get parameter be "c "?

Source: Internet
Author: User
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?thinkPHPExtracted by defaultGETIncAscontrollerFor scheduling. You canconfigFile replacementVAR_CONTROLLERTo select other parameterscontrollerIn 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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.