I have written a very simple example I have put together.
It works from a webpage but not in SpiderBasic. Here are the details.
The exe is written in PureBasic. Source code is:
Code: Select all
If Not InitCGI() Or Not ReadCGI()
End
EndIf
a$="<html>"+#CRLF$
a$+"<head>"+#CRLF$
a$+"<title>Test</title>"+#CRLF$
a$+"</head>"+#CRLF$
a$+"<body>"+#CRLF$
a$+"This is a test"+#CRLF$
a$+"</body>"+#CRLF$
a$+"</html>"+#CRLF$
WriteCGIHeader(#PB_CGI_HeaderContentType,"text/html",#PB_CGI_LastHeader)
WriteCGIString(a$)
The test html page is saved as cgitest.htm.
Code: Select all
<html>
<head>
<title>CGI Test</title>
</head>
<body>
<form action="http://edu0018486/bmv10/cgitest.exe" method="get">
<input type="submit" value="Go">
</form>
</body>
</html>
Using Chrome, http://edu0018486/bmv10/cgitest.htm opens the test page. Clicking on Go shows the result correctly.
(I run other pages and apps from the same folder so I know CGI is working there.)
SpiderBasic is installed in the same folder (bmv10).
The SB program code is:
Code: Select all
Procedure HttpGetEvent(Success, Result$, UserData)
If Success
Debug Result$
Else
Debug "Error"
EndIf
EndProcedure
HTTPRequest(#PB_HTTP_Get,"http://edu0018486/bmv10/cgitest.exe", "", @HttpGetEvent())
Any ideas?