[Tutor] CGI implementation

Max Noel maxnoel_fr at yahoo.fr
Mon Oct 11 01:28:55 CEST 2004


On Oct 6, 2004, at 22:46, Adam Bark wrote:

> Is it possible to run a CGI script from IE6 from the hard drive? 
> Everytime I try to open a CGI script from HTML it just shows the 
> script. Also when putting the script on the internet do you have to 
> host the script and Python? I wanted to use something Lycos Tripod 
> free hosting which doesn't have enough space for Python and no 
> cgi-bin. Thanks
> Adam

	Here's what happens when you consult a CGI page on the Internet:
- Your web browser sends a request for the page (for example, 
/index.py) to the web server.
- The server gets the request, extracts the file name from it, and 
checks whether or not the file exists.
- The file exists. If it were an HTML document, the server would just 
send its contents back to you. However, the server detects that it is a 
Python script, so instead it loads a Python interpreter, runs the 
script and sends the standard out back to your browser.
- Your browser, which has no idea of what's going on backstage, 
receives a stream of data which happens to be HTML, and renders it.

	All of this means that to be able to test CGI scripts on your local 
machine, you'll need to install a web server. Apache, which can be 
found at http://httpd.apache.org/ , is a powerful, secure and Free web 
server

-- Wild_Cat
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting 
and sweating as you run through my corridors... How can you challenge a 
perfect, immortal machine?"



More information about the Tutor mailing list