In version 6.7, 4D fully supports CGI's (Common Gateway Interfaces). At the same time, you can also use 4D as a CGI for WebSTAR and give WebSTAR direct access to 4D. The method inside 4D can be called by WebSTAR to execute a task and return an answer, i.e. a full Web page or some HTML code inserted in the page sent by the server. To illustrate this procedure, you may follow these steps.
* Create a database (It can be named anything. In this case, we name it "TestCGI").
* Create a project method call "Launch_HTML".
* Add the following code to Launch_HTML:
SEND HTTP REDIRECT("https://xxx.xxx.xxx.xxx/HelloWorld.html")
Note: xxx.xxx.xxx.xxx is your IP address
* Copy or make an alias of 4th Dimension to WebSTAR cgi-bin folder. Then name the 4D alias to 4D.acgi.
* Create an HTML document called HelloWorld.html.
*
Hello World
* Place your HelloWorld.html in the same folder as WebSTAR Server.
* Launch your WebSTAR Server.
* Launch a Web browser on another machine. Type the following address into the address field:
xxx.xxx.xxx.xxx/cgi-bin/4D.acgi$/4daction/Launch_HTML
* Your hello world page should appear on your Web browser.