You can write a script for yourself, if you know a high level programming language (Knowledge of C and UNIX is good). As I said before you can write CGIs using a Perl, C/C++ or Visual Basic but writing a CGI script needs in-depth knowledge of shell script concepts in UNIX (or UNIX family of servers) and the internal constructs of the UNIX standard. You need a web server for running CGIs and Apache web server is a best choice for UNIX family of servers. For more details and for download visit Apache. Moreover, the script is allowing your visitor to interact with the web server, and hence you need to keep the security concerns in your mind. To handle that, the script has to be written and tested well. You should ensure that it obeys the security regulations, so that it doesn’t crash the system.
It is necessary to write a CGI script by yourself, since there are thousands of scripts available on the web. Most of them are free for nonprofits. Mostly they are available in compressed format. (.zip format for DOS and windows, .tar or .tar.gz or .tar.z formats for UNIX). When you find a good script on the web, all you need to do is to download, decompress and install it. After decompressing, you will have a set of files that can be installed on your server.