aboutsummaryrefslogtreecommitdiff
path: root/t/front.tc
blob: f95d8cbffdb0ccf900580b5de12d8b12800742db (plain)
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
#include "head.tc" 
printf("\n<h1>");
printf("%s",  site.name );
printf("</h1>\n<p>Thanks for the ");
printf("%s",  getenv("REQUEST_METHOD") );
printf(" request!</p>\n<table border=\"1\">\n	");
	struct post *post;
	struct user *user;
	
	while(post = getpost(stmt, 0)){
		user = getuser(byid("users", post->user), 1);
	
printf("\n	<tr>\n		<td><a href=\"?user=");
printf("%d", post->user); 
printf("\">");
printf("%s", 
			user->name
		);
printf("</a></td>\n		<td><a href=\"?post=");
printf("%d", post->id); 
printf("\">");
printf("%s", 
			post->subject
		);
printf("</a></td>\n	</tr>\n	");
	}
	
printf("\n</table>\n");
#include "foot.tc"