#include #include #include #include #include #include #include main(int argc, char **argv) { #define gnezdokey "gnezdokey" #define buttons "buttons" #define stampdir "/usr/local/www/cgi-bin/www.gazeta.ru/online/stamp" struct timeb tp; struct stat st; char sgnezdotime[63]; char qs[255]; long gnezdotime; long buttonstime; printf ("Content-type: text/html\n\n"); //printf("",getenv("QUERY_STRING")); strcpy(&qs[0],getenv("QUERY_STRING")); if (strlen(qs)<10) { stat("/bhome/part2/01/vh01002/vcgi/chat/chats/chat.football",&st); gnezdotime=st.st_mtime; stat("/bhome/part2/01/vh01002/vcgi/chat/stamp/buttons",&st); buttonstime=st.st_mtime; //ftime(&tp); gnezdotime=time(NULL);//tp.time; //buttonstime=tp.time; buttonstime=st.st_mtime; } else { //printf ("%s
",qs); strncpy(sgnezdotime,&qs[strlen("gnezdokey=")],9); sgnezdotime[9]=0; gnezdotime=atol(sgnezdotime); strncpy(sgnezdotime,&qs[strlen("gnezdokey=123456789&buttons=")],9); sgnezdotime[9]=0; buttonstime=atol(sgnezdotime); stat("/bhome/part2/01/vh01002/vcgi/chat/chats/chat.football",&st); if (st.st_mtime > gnezdotime) { gnezdotime=st.st_mtime; printf ("\n"); } stat("/bhome/part2/01/vh01002/vcgi/chat/stamp/buttons",&st); if (st.st_mtime > buttonstime) { buttonstime = st.st_mtime; printf("\n"); } } //printf("gnezdo=%ld
",gnezdotime); //printf("buttons=%ld
",buttonstime); printf("",gnezdotime,buttonstime); printf("gnezdokey=%ld&buttons=%ld time=%ld",gnezdotime,buttonstime,time(NULL)); //printf("",gnezdotime,buttonstime); }