SIMPOL Documentation

Other Features

Obviously just being able to respond to requests isn't bad, but there are a number of things that a program needs to be able to do when acting as a web application. One common requirement is to support cookies, both session cookies (that expire when the browser is closed) and standard cookies with an expiration date. The cookie support built into the cgicall type fulfills both of these requirements. Another useful feature is the ability to return content of various types, such as sending a file to be saved on the target machine. This is also supported, since the first line that must be sent back by the cgicall object is the Content-type line. This is different from the HTML meta tag content-type, since that already presumes a content-type of text/HTML. Using this capability it would be possible to create an e-commerce site that sells programs and after payment sends the file automatically to the browser where it can be saved. By not having a download directory that is static, the files are not available except via the program, which can test the user's right to access the download in the first place. It is also possible to interact with web server applications elsewhere that require a content-type that is different from the basic one.

In addition to the content-type and cookie support SIMPOL's CGI implementation also includes full support for both GET and POST. The correct way to use these items is specific to CGI and is outside the bounds of this document, but there are a multitude of books and web pages that discuss the use of CGI.

Finally, there is also support for retrieving environment variables, form variables, and even the input stream for allowing uploads from browsers directly to the program (such as uploading a company logo as a JPEG). In addition to all of the CGI-specific capabilities, there is still the entire range of capabilities built into SIMPOL. For example, using the CGI support combined with the TCP/IP socket support it is possible to create a web-based email system. Using the tcpsocket type an SMTP email client (even a server) together with a POP3 client could be written. Add to that the support for PPCS and the web pages can even be built based on data in a Superbase database. This would permit any number of web-enabled front-ends to be written to work together with an existing Superbase application. There is simply no advantage to trying to use a product like Microsoft's ASP framework with Superbase database tables via the ODBC driver when access via SIMPOL using PPCS will provide a faster and more reliable solution all from the same software house. Not only that, but once the application has been written and compiled, all that is needed to switch to a Linux or Unix-based web server is to link the appropriate Linux shebang line (which must have only a trailing linefeed) to the front of the already compiled program and place it on the Linux machine in the appropriate location. No change to the source or even the compiled program is necessary!