| WHAT IS A CGI?CGI stands for common gateway interface. Essentially, a CGI is just a program which runs on your server. It can be written in any programming language, so long as you can run it on your server. Perl has become a popular choice for CGI programming because it is available for all platforms, and it has many useful tools that are ideal for the web. When I fill in a form on a web page and press 'Submit', 2 things happen on the server.
The first thing the program will usually do is request the contents the web page form, and assign it to variables which it can use. Then the program is able to search a database or send an e-mail or add to a guestbook, or whatever you would like it to do. As with the JavaScript tutorial, this tutorial will teach by example. For each new topic, we will examine the entire code, then break it down into small pieces and discuss the relevance of each line. Before you can use Perl on a Unix server, however, you will need to know a little bit about Unix. THE UNIX ENVIRONMENTYou must have the ability to Telnet to your Unix server in order to create CGIs with Perl. Click here if you do not know how to do this. You must have the ability to FTP documents to your server. You probably have already done this, as it is necessary to publish anything on the web. There will be times when using Unix when it will seem that we have traveled 20 years back in time. The editors and commands are typed on a command line, as we did with DOS. Actually, Unix is by far the most powerful and flexible operating system available. When used at a local terminal, users use a graphic interface called X-Windows. X-Windows is too slow to use over the internet, however, so we will use the command line for the few Unix commands we need. The command PromptEvery time you enter a new line into Unix, you will get a command prompt. It often appears as your machine's name followed by a % or # symbol. This is where you enter your basic commands to create, copy, move, and delete files, among other things.
Try this exercise:
| |||
| ||||
Home | WebData - Web Database Software | Javascript | CGI | Consulting | Map Builder | Contact Us | The Press Room |