how to print my CGI programs output inside an HTML
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
this is not what I want because that complicates the web page design. and if i give a text based counter service, it would be difficult for customers to use the counter in their page, forcing them to use frame
Well then... your choices are: use an <iframe> it is simple to use and avoids the issues of <frame>, or use a flash movie and return the output into it.
Yet another option would be to use a layer but I think that could complicate things... (you just got me thinking here!! )
i dont know how iframe works, i will examine it now however it does not sound so good to me to use iframe to print only one single line of sentece for example. lets take the counter service example, my cgi script will only output the number of people who visited the member site. using iframe for only showing this number?... i think there should be other way like <script src=counter.cgi> way but how..
Very well then... use SSI and an include file. That will do exactly what you want. You end up using text, the output gets to the client from the server and no fuss whatsoever with <frames> and/or <iframe>
Read you apache manual for details.
Making a graphical counter may be a bit more challenging. But using it is simpler, because you can put a simple IMG tag in a page. For example (to use one that Google returns for "counter"), <img src="http://freelogs.com/counter/index.php?u=asdf"> (you may want to incude width and height for smoother page layout). I'm not aware for an equally simple way to include external HTML fragments.
thanks for everyone who tried to help and actually helped
here is what works
My CGI script, named third.cgi after compilation (written in C)
printf("document.write('Hello from Istanbul, Turkey');\n");
When it is called from a page by