Copyright © 2020, Molsoft LLC
Apr 29 2022
Common Gateway Interface (CGI) is a standard method used to generate dynamic content on web pages and web applications. CGI, when implemented on a web server, provides an interface between the web server and programs that generate the web content. These programs are known as CGI scripts or simply CGIs; they are usually written in a scripting language, but can be written in any programming language including ICM.
An ICM CGI script consists of the following important elements:
The simplest 'Hello World' ICM CGI script may look like this:
#!/usr/prog/icm/icm64 -w/usr/prog/icm printf "Content-type: text/html;\n\n" print "Hello from ICM SGI script" quit
Tables in HTML output
ICM provides a command show html to generate a nicely formatted HTML code for shell tables. The command generates fully self-contained HTML code with head and body tags. If you CGI script produces a single HTML table you can use this command as is.
#!/usr/prog/icm/icm64 -w/usr/prog/icm printf "Content-type: text/html;\n\n" params = Collection(web) if (Exist(param["filename"])) then # reads sn SDF file on the server read table mol param["filename"] name="t" show html t endif quit
Integration with Molsoft HTML5 Molecule Editor
Please click here to learn how to embed molecule editor into your html code.
Chemical Search Script Demo
The example which demonstrates the functionality above: Chemical Search Demo
|Copyright© 1989-2020, Molsoft,LLC - All Rights Reserved. Copyright© 1989-2020, Molsoft,LLC - All Rights Reserved. This document contains proprietary and confidential information of Molsoft, LLC. The content of this document may not be disclosed to third parties, copied or duplicated in any form, in whole or in part, without the prior written permission from Molsoft, LLC.|