File: form2.c

package info (click to toggle)
libcgi 1.0-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 940 kB
  • ctags: 268
  • sloc: sh: 2,700; ansic: 2,134; makefile: 232
file content (52 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include "cgi.h"

int main(void)
{
	cgi_init();
	cgi_process_form();
	cgi_init_headers();

	puts(""
	"<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>"
	"<html>"
	"<head>"
	"	"
	 " <meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>"
	"	"
	 "   <meta name='author' content='Rafael Steil'>"
	  "    <title>LIBCGI Examples</title>"
	   "   </head>"
	   "  <body text='#000000' bgcolor='#ffffff' link='#0000ee' vlink='#551a8b' alink='#0000ee'>"		
	"");

	// NAME
	if (cgi_param("name"))
		printf("Name: %s<br>", cgi_param("name"));
	else
		puts("Name: Empty<br>");

	// AGE
	if (cgi_param("age"))
		printf("Age: %s<br>", cgi_param("age"));
	else
		puts("Age: Emtpy<br>");

	// GENDER
	printf("Gender: %s<br>", cgi_param("gender"));

	// RADIO BUTTON 1
	printf("Radio Button 1: %s<br>", cgi_param("radiobutton1"));

	// RADIO BUTTON 2
	printf("Radio button 2: %s<br>", cgi_param("radiobutton2"));

	puts(""
	"</body>"
	"</html>"
	"");	

	cgi_end();
	
	return 0;
}