summaryrefslogtreecommitdiff
path: root/src/webserver/pages/sample.c
blob: 7bec663f27ad9054b0c7b80330b8819ec4ac6334 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
void generate_sample(int sock_in, char *query, char *ip)
{

	char *name = get_param(query, "name");

	web_send(sock_in, "<title>SAMPLE</title>\n");


	//If a name was not entered...
	if ( name == '\0' )
	{
		web_send(sock_in, "<form action=\"/testing/\" method=\"GET\">\n");
		web_send(sock_in, "<input type=\"text\" name=\"name\">\n");
		web_send(sock_in, "<input type=\"submit\">\n");
	}
	else
	{
		web_send(sock_in, "Your name is: ");
		web_send(sock_in, get_param(query, "name"));
	}
printf("OK!\n");
}