Basic HTML version of Foils prepared 2 Sept 1997

Foil 19 Some CGI programming practical tips

From CGI Programming with Advanced Topics Jackson State University Mississippi -- Fall Semester 97. by Nancy McCracken *

1 On the web server that you are doing CGI programming, put the HTML pages with forms in a directory somewhere under the server's "document root" and the CGI program somewhere under the server's "cgi bin". The CGI program must have permissions properly set to be executed by the server. Furthermore, if the CGI program reads or writes to other files, then the server must have permission to do so.
2 You should first debug your Perl program by executing it directly on the command line. If using ReadParse, there is a version that will also take input from STDIN. The param function of CGI.pm also allows this type of debugging:
3 prog.pl < input.data
4 When a CGI program has an error of any kind, it almost always generates an error message that the error is in the header. In fact, the error could be anywhere.

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Sep 2 1997