PHP call VB DLL files, access to the domain name is invalid?
Time:11-08
' vb DLL functionThe Public Function my_yuming () My_yuming=Request. ServerVariables (" Server_name ") End the Function
The Public Function my_shu () My_shu=1 + 2 End the Function
PHP call the DLL file my_yuming function error But call my_shu function is normal, display 3
Asp call the DLL file my_yuming function normal display
Can you tell me the PHP directly obtained in the DLL function domain information?
CodePudding user response:
The up The up The up up
CodePudding user response:
00. PHP source code: <? PHP
$obj=new COM (" zcy_gch_php. Zcy_class ");
//$output=$obj - & gt; My_shu (); //echo $output;//display the results
$output=$obj - & gt; My_yuming (); Echo $output;//display the results
?>
Error message:
Fatal error : Uncaught exception 'com_exception with message' & amp; lt; B& gt; Source: & amp; lt;/b& gt; Zcy_gch_php & amp; lt; Br/& amp; gt; & lt; B& gt; Description: & amp; lt;/b& gt; Not set a variable or object With block variables' in D: \ 00 ceshi \ WWW \ PHP: 8 The Stack trace: # 0 D: \ 00 ceshi \ WWW \ PHP (8) : com - & amp; gt; My_yuming ()
CodePudding user response:
Try: The Public Function my_yuming () as string
CodePudding user response:
Since tip not set the variable "object", that are Request this object was not created when PHP call? In the DLL code try putting a judgment: The Public Function my_yuming () If the Request is nothing then My_yuming="Error." The else My_yuming=Request. ServerVariables (" Server_name ") Endif End Function