Hi all,
I would like to be able to launch an executable (e.g. Notepad.exe) from SPIDERBASIC using PUREBASIC CGI. Is it possible. If not, what are the solutions that would allow me to get around the problem?
CGI PUREBASIC and external programm (ex. Notepad.exd)
-
- Enthusiast
- Posts: 552
- Joined: Tue Oct 14, 2014 12:09 pm
Re: CGI PUREBASIC and external programm (ex. Notepad.exd)
Yes, that is possible. However, you must note that in this case you start Notepad on the server (the computer that hosts your SpiderBasic site); not on the client (the computer on which the browser displays your website).
Hygge
-
- Enthusiast
- Posts: 552
- Joined: Tue Oct 14, 2014 12:09 pm
Re: CGI PUREBASIC and external programm (ex. Notepad.exd)
Thank you Kiffi for your reply.
Would it be possible for you to correct these two programmes for me so that I can test them, as I can't do it.
Partie SB
Partie PB
The aim is to be able to launch an executable on the server from SB.
Would it be possible for you to correct these two programmes for me so that I can test them, as I can't do it.
Partie SB
Code: Select all
procedure HttpGetEvent2(Success, Result$, UserData)
If Success
Debug result$
EndIf
EndProcedure
Procedure btn_login_Action2()
Global url.s="https://sxxx/xxx/caressai.exe"
HTTPRequest(#PB_HTTP_Post, url, "",@HttpGetEvent2())
EndProcedure
btn_login_Action2()
Partie PB
Code: Select all
If Not InitCGI() Or Not ReadCGI()
End
EndIf
RunProgram("notepad.exe")
WriteCGIHeader("Access-Control-Allow-Origin", "*") ;<----------- Remove for Final Release !!!!!!;
WriteCGIHeader(#PB_CGI_HeaderContentType,"application/vnd.microsoft.portable-executable",#PB_CGI_LastHeader)
WriteCGIString(user$+"="+resultat$)
The aim is to be able to launch an executable on the server from SB.