a piece of CGI code runs in a web server context.
In it's simplest form, a web server accepts an http request
for a document and either sends the requested document or an
error message. A web server might hand back a document that
looks like this.
Code:
<html><head><title>easy html></title></head>
<body>
<p>Hello, I'm a web page</p>
</body>
</html>
With CGI, the http request can ask the web
server to run a program and send back the output from the
program.
For instance, if I have a computer with the Apache web server running on it and a piece of CGI that looks like this.
Code:
#!/usr/local/bin/perl
print "Content-type: html/text\n\n";
print "<html><head><title>easy html></title></head>
<body>
<p>Hello, I'm a web page</p>
</body>
</html>";
That is trivial piece of CGI, but, you see that it is a program that produces output that looks like an html page.
So, to get your CGI code to run in your browser, you must first get it onto a web server that supports CGI and the language the CGI is written in. There are quite a few possible approaches.
Download and install apache.
or - on a M$ system, get PWS - a pain and weak but it will
work.
or - use one of the free or low cost hosting companies
or - see if your internet service provider will work.
They usually give you a little disk space, you might
can do it there.
My first choice, everytime, is to download and install apache on whatever system you are using. There is a faq in this forum about setting apache up to do cgi on a Win NT system that might help. Or, just see apache's documentation. They are very good.
'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.