forked from rockcarry/ffhttpd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcgitest.c
27 lines (25 loc) · 861 Bytes
/
cgitest.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdlib.h>
#include <stdio.h>
static char *html = "\
<html>\n\
<head>\n\
<meta http-equiv='Content-Type' content='text/html;charset=iso-8859-1'>\n\
<style type='text/css'>\n\
input[type='text' ] { width:220px; font-size:16px; }\n\
input[type='submit'] { width:100px; font-size:16px; }\n\
h1 { font-size:32px; }\n\
td { font-size:18px; }\n\
</style>\n\
<title>ffhttpd cgi test</title>\n\
</head>\n\
<body>\n\
<h1>ffhttpd cgi test</h1><hr/>\n\
<p>hello ffhttpd cgi !</p>\n\
</body>\n\
</html>\n\
";
int cgimain(char *request_type, char *request_path, char *url_args, char *request_data, int request_size,
char *content_type, int ctypebuf_size, char *page_buf, int pbuf_size)
{
return snprintf(page_buf, pbuf_size, html);
}