Marc Hedlund has written a FAQ on CGI programming (URL is <URL:http://www.best.com/~hedlund/cgi-faq/> ) which makes a good introduction to the subject. The standard itself can be found at NCSA (URL is <URL:http://hoohoo.ncsa.uiuc.edu/> ).
For tips on overcoming common CGI problems, consult the CGI problems section and the section on granting CGI access to users.