OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / cgi_generic / template.c
1 /* template.c */
2
3 #include <stdio.h>
4
5 #include "cgivars.h"
6 #include "htmllib.h"
7
8
9 #define DEBUG           1
10
11 int template_page(char **postvars, int form_method) {
12         int i;
13         
14         addTitleElement("Demo CGI");
15
16         if(form_method == POST) {
17                 for (i=0; postvars[i]; i+= 2) {
18 #if DEBUG
19                         printf("<li>DEBUG: [%s] = [%s]\n", postvars[i], postvars[i+1]);
20 #endif
21                 }
22         }
23
24         /* GET */
25         printf("<FORM ACTION=\"%s\" METHOD=POST>", "/cgi-bin/cgi_demo");
26         printf("<SELECT NAME=\"port\">");
27         printf("<OPTION>COM 1");
28         printf("<OPTION>COM 2");
29         printf("</SELECT>");
30         printf("</TD></TR>");
31         printf("<BR><INPUT TYPE=submit VALUE=\"Submit\">");
32         printf("<INPUT TYPE=reset VALUE=\"Reset\">");
33         printf("</FORM>");
34                         
35         return 0;       
36 }
37
38