/* $Id$ */ #include #include #include int test(char *s) { char valid[] = "0123456789abcdef"; if (strlen(s) != 32) return 0; while (*s) if (!strchr(valid, *s++)) return 0; return 1; } int main() { char *s, *p; s = getenv("QUERY_STRING"); if (s) { printf("Content-type: text/html\r\n\r\n"); s = strstr(s, "key="); if (s) { s += 4; p = strchr(s, '&'); if (p) *p = '\0'; if (test(s)) printf("%s", s); } else printf("Alles OK"); } return 0; }