CGI (Common Gateway Interface) is a type of program that accepts input from a form on a web page, and generates dynamic output to the web browser. To integrate Qchat with the WWW, several CGI programs were used at key points to process information entered by users through forms, and to generate dynamic web pages based on user input and the files generated by the Qchat server. CGI was used to process new user information, set user preferences, provide information on the status of the server, and generate the page used to start the Qchat client. The use of the web to provide some of the services that would normally be provided by the Qchat client allows the client to be smaller in size.
One of the main advantages of the use of CGI in the implementation of Qchat is the ability to reduce the complexity of the client and server. This allows both to be smaller and run faster. The new user CGI form asks the user for their name, e-mail address and web page. This information is then stored on the server computer, accessible by other CGI programs and the Qchat server. Preferences are also handled by a CGI form. The user is asked to chose their preferences for the applet, including size, font, and colors. This information is then stored in another file on the server computer. The third use of CGI involves the viewing of users and channels currently on Qchat. These CGI programs do not accept user input, they read the current user and channel information from files generated by the Qchat server and send them to the user's web browser. This allows the user to refresh the lists by simply reloading the web page. The final and most important CGI program is the one that actually generates the page that the Qchat client runs in. This program gets information from both the user file and the preferences file. The CGI program checks the user list file to make sure the user has entered a valid login name. If the login name is invalid a message is displayed to the user. If a valid username is entered the CGI program then looks to see if the user has entered preferences in the preferences file. If a preferences entry for that user exists the preferences are added to the web page for the applet, if they are not available a set of default preferences are used. The CGI program translates the preferences in the file into parameters that are passed onto the Qchat client. The use of CGI gives Qchat an advantage over other chat systems.