×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Output from CGI

Output from CGI

Output from CGI

(OP)
I have CGI on Apache server. When a request comes in for this CGI, server invokes CGI and output is sent back to the client.

When I was reading book on CGI, this sentence I could not understand. "Once CGI program starts running, it sends its output back to the web server via standard output."

CGI is already on the server and thats where it runs. So where is the question of sending output "back to web server" ? STDOUT sends output on the terminal. So if I am working on server, then on that terminal, output will come. I am on a different terminal than server and sending request from this terminal. In this case, output is sent to client terminal. Is it still standard output ?

Pls explain.  

RE: Output from CGI

CGI sends its output to the server, probably an http server, which sends the data back to the client, usually a web browser.

------------------------------------------
- Kevin, perl coder unexceptional! wiggle

RE: Output from CGI

(OP)
Does CGI reside outside the web server ? Is CGI invoked on anywhere else than web server ?
If CGI is on web server in /cgi-bin directory. So whenevr a CGI is invoked, it is processed on web server only and output is on web server only. So where is the question of sending output to web server ?

Pls explain

RE: Output from CGI

In a nutshell.....

CGI is a type of communication between computers, just like HTTP and FTP are also ways computers communicate. A CGI script (could be written in many differnt programming languages) sends its STDOUT to the server, the server eventually sends the output from the CGI script back to a client, the client could be a web browser or another server.  

------------------------------------------
- Kevin, perl coder unexceptional! wiggle

RE: Output from CGI

I think you're getting confused by the phrase "web server", and interpreting it to mean "a computer attached to the internet that serves up web pages". Viewed like that, as you observe, the description of the cgi program outputting to the web server doesn't make much sense.

But "web server" can also describe a bit of software running on a computer that enables it to serve stuff to the web. Apache is a web server, for example. That's the context your book is using:

Quote:

Once CGI program starts running, it sends its output back to the web server [software running on your computer] via standard output.
If I'd written it, I'd have included the italic bit to avoid confusion!

The bottom line is, though, that a program invoked across the web using cgi sends its standard output (eventually) to the web browser session that invoked it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close