There are a number of sites where you can get a large variety of CGI scripts for free that already do what you are trying to do. Unfortunately, in many cases, you get what you pay for. If you are interested in writing your own CGI program from scratch, there are a number of tools to help you do this. The language of choice in CGI programing is Perl, as it is very condusive to a rapid development cycle. If you are planning to use Perl, you can find a variety of Perl modules that will greatly reduce the effort in creating CGI programs.
Cookies are an extremely useful tool for storing state information.
Cookies are stored on the client browser, and passed back to the web server that set them. You will find a very detailed cookie tutorial and FAQ at Cookie Central . The important thing when you ask a question about a particular CGI problem is to provide information. Questions contining the above information can generally be answered very quickly. This question is addressed in some detail in the HWG-Servers mailing list FAQ .