How do I receive post data from URLs generated by thinkPHP router rules?

Source: Internet
Author: User
When I use vba to pass parameters to php, if it is a common php file, it will be acceptable, and the url generated using the thinkPHP framework will not be received. what is the problem? The following is the vba code: {code ...} the following succeeded: {code ...} {code ...} when I use vba to pass parameters to php, if it is a common php file, it will be acceptable, and the url generated using the thinkPHP framework will not be received. what is the problem?

The following is the vba code:

    Set obj = CreateObject("Microsoft.XMLHTTP")    obj.Open "POST", sUrl, False    obj.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"    obj.send (sData)

The following are successful:

SUrl = "http: // localhost/VbaPostDemo. php" sData = "a = 1 & B = 2" // corresponding directory: C: \ AppServ \ www \ VbaPostDemo. php
  
The following failed: sUrl = "http: // localhost/yb1/Home/curd/futuresDemo" sData = "a = 1 & B = 2" controller function: function futuresDemo () {echo $ _ REQUEST ["a"];} error message: ":( invalid operation: 1 error location FILE: C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ Controller. class. php LINE: 170 TRACE #0 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ Controller. class. php (170): E ('\ xE9 \ x9D \ x9E \ xE6 \ xB3 \ x95 \ xE6 \ x93 \ x8D \ xE4 \ xBD \ x9C: 1 ') #1 [internal function]: Think \ Controller->__ call ('1', '') #2 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ App. class. php (114): ReflectionMethod-> invokeArgs (Object (Home \ Controller \ CurdController), Array) #3 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ App. class. php (204): Think \ App: exec () #4 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think. class. php (120): Think \ App: run () #5 C: \ AppServ \ www \ yb1 \ ThinkPHP. php (97): Think \ Think: start () #6 C: \ AppServ \ www \ yb1 \ index. php (27): require ('C: \ AppServ \ www \\... ') #7 {main} ThinkPHP3.2.3 {Fast & Simple oop php Framework} -- [we can do it just think]"

Reply content:

When I use vba to pass parameters to php, if it is a common php file, it will be acceptable, and the url generated using the thinkPHP framework will not be received. what is the problem?

The following is the vba code:

    Set obj = CreateObject("Microsoft.XMLHTTP")    obj.Open "POST", sUrl, False    obj.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"    obj.send (sData)

The following are successful:

SUrl = "http: // localhost/VbaPostDemo. php" sData = "a = 1 & B = 2" // corresponding directory: C: \ AppServ \ www \ VbaPostDemo. php
   
The following failed: sUrl = "http: // localhost/yb1/Home/curd/futuresDemo" sData = "a = 1 & B = 2" controller function: function futuresDemo () {echo $ _ REQUEST ["a"];} error message: ":( invalid operation: 1 error location FILE: C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ Controller. class. php LINE: 170 TRACE #0 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ Controller. class. php (170): E ('\ xE9 \ x9D \ x9E \ xE6 \ xB3 \ x95 \ xE6 \ x93 \ x8D \ xE4 \ xBD \ x9C: 1 ') #1 [internal function]: Think \ Controller->__ call ('1', '') #2 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ App. class. php (114): ReflectionMethod-> invokeArgs (Object (Home \ Controller \ CurdController), Array) #3 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think \ App. class. php (204): Think \ App: exec () #4 C: \ AppServ \ www \ yb1 \ ThinkPHP \ Library \ Think. class. php (120): Think \ App: run () #5 C: \ AppServ \ www \ yb1 \ ThinkPHP. php (97): Think \ Think: start () #6 C: \ AppServ \ www \ yb1 \ index. php (27): require ('C: \ AppServ \ www \\... ') #7 {main} ThinkPHP3.2.3 {Fast & Simple oop php Framework} -- [we can do it just think]"

Use other Post tools for testing, such as Postman, to see if this happens. if so, it indicates your code or TP problem. if not, it indicates your vba problem.

It is estimated that the path is wrong. you should manually click the path in the browser to report the same error!

M, c, a disabled (used internally ).

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.