Web Extensions and Applications Using FastCGI
By Scott Dybiec and Philip Rousselle
Dr. Dobb's Journal June 1997
#include <time.h> #include <fcgi_stdio.h> main() { time_t tod; long count = 0; while(FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n"); printf("\r\n"); time(&tod); printf("The current time of day is <b>%</b>s <BR>", ctime(&tod)); printf("\r\n"); printf("This page has been accessed <b>%</b>d times<BR>", ++count); } exit(0); }
Example 2: FastCGI reference counter.
Copyright © 1997, Dr. Dobb's Journal