Switch to full style
What's behind JSP & Servlets
Post a reply

Basic daynamic page generation using CGIs programs

Fri Jun 22, 2007 8:59 pm

This topic is about providing a solution to the problem of dynamic content has been available since the earliest days of the Web. Rather than reading the data from a file, the server can run a program in order to generate the data.

-The mechanism by which the server and the HTML-generating program communicate is called CGI (common gateway interface).

-CGI is a program is being run behind the scenes enables the content to be dynamic.


-The earliest CGIs were written in a language called C. A sample CGI written in C is shown in the following list. It generates a Web page that contains the current time and date.


cpp code
#include <stdio.h>
#include <time.h>

int main(int argc, char **argv) {
time_t now;

printf("<HTML>\n");
printf("<BODY>\n");

time(&now);
printf("The time is now: %s", ctime(&now));

printf("</BODY>\n");
printf("</HTML>\n");

exit(0);
}




Post a reply
  Related Posts  to : Basic daynamic page generation using CGIs programs
 Calling other programs from java     -  
 How to Write Small,Useful and Efficient Programs     -  
 About Report Generation     -  
 Image Scroller-scrollbar-LINE_UP,LINE_DOWN-PAGE-UP-PAGE-DOWN     -  
 Image Files Generation     -  
 Some basic tips for SEO     -  
 Basic Pointers     -  
 dynamic crystal report generation     -  
 Transforming XML into Basic HTML     -  
 Java basic tutorials.doc     -