How to display the result of a CGI program in the original web page?

C

Chen Zhigao

I have a web page to submit some inputs to a CGI program (written in C)
on server. The CGI may generate some messages after processing the
inputs. And I want to display these messages back to the web page.

But the problem is that CGI programming seems required to begin with a
"Content-type: text/html" line. It results in generating a new web page
in the browser window, and I have not found a solution to pass messages
between two web pages.

Hence, I wonder whether the browser window can remain in the original
page while the CGI program is still able to process the inputs without
the line. Any pointer is much appreciated.
 
T

Thomas 'PointedEars' Lahn

Chen said:
But the problem is that CGI programming seems required to begin
with a "Content-type: text/html" line.

CGI requires the server to respond with a valid Internet message, hence the
response must contain a Content-Type HTTP header. Whether that response is
an HTML document or not, does not matter.
It results in generating a new web page in the browser window,

It results in displaying the response message as resource if supported by
the user agent.
and I have not found a solution to pass messages between two web pages.

The basic misconception is that there are Web _pages_.
Hence, I wonder whether the browser window can remain in the original
page while the CGI program is still able to process the inputs without
the line. Any pointer is much appreciated.

<http://en.wikipedia.org/wiki/AJAX>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top