Getting a generated webpage to show

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

This is a sort of HTML question, but probably comes more under an apache

I have an SQL database and a C program which sits above it to do the
interogation of the database, it also generates a webpage from the
results. All of this works and the webpage created is even w3c 4.01

My question really is two fold.

One, once generated, how do I get the page displayed? I did play around
with a system call  to launch the browser, but that would result in
another instance of the browser which I'm not after (it would also look
bloomin' awful)

Two. As the pages are transient, if they are not wiped at the end of the
session, then they will get out of hand. Am I better off making the page
non-transient and store the filename and creation date in the SQL database
and if the page is called again, check the info is still correct by
re-examining the SQL database and altering if required?

As I say, I'm sorry if this is OT, but advice would be appreciated. I
don't know PHP, perl or cgi particularly well. I am learning C# if that is
of more use though.



"There are four stages to any war
First they ignore you, then they laugh at you
Then they fight you, then YOU win."

Re: Getting a generated webpage to show

Paul F. Johnson wrote:

Quoted text here. Click to load it

The simplist way to do this would probably be to use CGI.

Quoted text here. Click to load it

CGI is very very simple. Have your C program output "Content-type:
text/html\n\n" along with whatever http headers you want before it outputs
anything else. Then print your HTML to STDOUT.

There are a number of CGI libraries for C that could help you (they do
things like handling the http headers for you and parsing query strings
(the bit of the URI after the ? symbol)).

David Dorward       < <
                     Home is where the ~/.bashrc is

Re: Getting a generated webpage to show

David Dorward wrote:

Quoted text here. Click to load it

Agreed, CGI is probably the way to go. You needn't even modify your C
program -- just use a shell script wrapper:

echo "Content-Type: text/html"
echo ""

Toby A Inkster BSc (Hons) ARCS
Contact Me -

Site Timeline