For sites that need some added functionality, CGI (Common Gateway Interface) is just the thing for you. Think of an ordinary webpage as being a bicycle on the information superhighway, if you will. It will get you and your viewers where you want to go and show what you want to see. But a webpage that has CGI behind it is like a car. It can go further faster and easier.
What exactly does CGI do? It adds power to your page. Ordinary pages are a presentation. CGI is a way to add in applications as well.
Say you want to make a mailing list of people who visit your site. You have a small form created that when it is filled out, it stores the email address of the viewer to a file. That is a CGI application. Or to have the results of a form emailed to you.
There are two basic forms of CGI: visual and functional. Visual CGI would be done in Java, probably, as it is the most common language for that purpose. This would be if you wanted something like buttons are black and white until you move the mouse onto them where they change to color, and if you click on them change to a different color. Visual CGI enhances the look of the page; however the extra code and compiling time does slow the page loading time down somewhat.
Functional CGI deals with what happens when a certain action is done. When you click on the submit button of a form to send an email registration, that would be done in Functional CGI, probably either in Perl Script, C, or Unix shell scripting. Each language has its own advantages and disadvantages; usually which one is chosen is dependant on which would generate the smallest amount of code. Functional CGI does not slow down the page as it is used for work that is done behind the scenes.