ShellSpider/home/test/cgi-test-c.c
2017-11-21 22:33:36 +01:00

18 lines
390 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
if (strlen(getenv("QUERY_STRING")) == 0) {
printf("Status: 302 Found\n");
printf("Location: ?foo=bar\n\n");
} else {
printf("Content-Type: text/plain\n\n");
printf("This Server is running %s.\n", getenv("SERVER_SOFTWARE"));
printf("The query string is %s.\n", getenv("QUERY_STRING"));
}
return 0;
}