Continued from page 1
3) Each of input tags includes a variable name. The data which is retrieved from visitor (or directly set if tag includes "hidden" qualifier) is placed in variable name.
4) When visitor presses "submit" button, CGI routine which was specified in form tag is executed. At this time, CGI routine "takes control", meaning browser essentially is waiting for it to complete.
5) This CGI routine can get data from variable names. It retrieves data and does whatever action is required.
6) When CGI routine finishes, it returns control back to web client (the browser).
Some important things to remember about CGI routines:
- You can install CGI routines on your own site if your host allows it - Addr.Com is an example of a web host which allows for CGI routines. Some web hosts do not allow you to install your own routines but do provide some pre-written ones to you. If these are not sufficient for your needs, you can find a remote hosting service to provide necessary functions.
- Generally, if you install your own routines they must be installed in cgi-bin directory of your site. This is a special location which allows scripts and programs to be executed.
- CGI routines work best on Apache-style servers. Windows NT and Windows 2000 does support CGI, but it tends to be slow and problematic.
- If you use a remote hosting service, you must remember that although they appear to be giving you this for free, you are actually paying a price. Usually they want to display advertisements, although some of them actually take visitors away from your site.
- When you write a CGI routine, you have choice of a scripting language like PERL or a compiled language such as C++ or Visual Basic. Anything which can execute on web server is acceptable.
I hope this short introduction to CGI has cleared up some of mystery.
Richard Lowe Jr. is the webmaster of Internet Tips And Secrets. This website includes over 1,000 free articles to improve your internet profits, enjoyment and knowledge. Web Site Address: http://www.internet-tips.net Weekly newsletter: http://www.internet-tips.net/joinlist.htm Daily Tips: mailto:internet-tips@GetResponse.com