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 ).