frames and cgi

Does anyone know if there is a way of getting a cgi program to produce output to more than one frame. I tried using the multipart/mixed mime type along with a seperate Content-type and Window-target for each piece of the multipart document but this didn't work.

Basically I have an html document which contains two frames called header and footer.

I would have expected this to display the first html document in the header window and the second in the footer window. This is not the case! The second document actually over-writes the first. It appears that the the http header 'Window-target' is not interpreted at all in a multi-part document.

The html for the frames is :-

<html>
<head><title>Frame Template</title></head>
<frameset rows ="200,*">
    <frame src="/cgi-test/frame" marginwidth="0" marginheight="0" scrolling="no" noresize name=header>
    <frame marginwidth="0" marginheight="0" scrolling="no" noresize name=footer>
</frameset>
</html>

the code for the cgi is :-

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int main(int argc, char **argv) {

        printf("Content-type: multipart/mixed;boundary=ThisRandomString\n");
        printf("\n--ThisRandomString\n");

        printf("Content-type: text/html\nWindow-target: header\n\n");

        printf("<HTML><HEAD><TITLE>top</TITLE></HEAD>");
        printf("<BODY BGCOLOR=\"000000\" TEXT=\"FFFFFF\">");
        printf("<H1>This should be the top bit</H1>");
        printf("</BODY></HTML>");

        printf("\n--ThisRandomString\n");

        sleep(5);

        printf("Content-type: text/html\nWindow-target: footer\n\n");

        printf("<HTML><HEAD><TITLE>bottom</TITLE></HEAD>");
        printf("<BODY BGCOLOR=\"FFFFFF\" TEXT=\"000000\">");
        printf("<H1>This should be the bottom bit</H1>");
        printf("</BODY></HTML>");

        printf("\n--ThisRandomString--\n");
}

If anyone has got this to work then I'd love to know

Andy Coles
Web Programmer
News International

Received on Tuesday, 23 April 1996 05:14:06 UTC