Cgi Written In C - M86 Security Web Filter HL User Manual

Table of Contents

Advertisement

A
S
PPENDICES
ECTION
438
A
B
PPENDIX

CGI written in C

/*
* cusc_block.c
* Description: sample C source code of CGI for customized block page
* Replace <Web Filter IP> with real IP and recompile before using
* Revision: 1
* Date: 03/08/2004
*/
#include <stdio.h>
struct {
char *name;
char *val;
} entries[20];
char szIP[16];
char szURL[1024];
char szUserName[1024];
char szCategory[8];
/*function prototypes*/
void printhtml();
void unescape_url(char *url);
char x2c(char *what);
char *makeword(char *line, char stop);
void plustospace(char *str);
char *fmakeword(FILE *f, char stop, int *cl);
int to_upper(char *string);
void getquery(char *paramd, char **paramv);
void getnextquery(char **paramv);
int main(int argc, char **argv)
{
int data_size; /* size (in bytes) of POST input */
int index;
char *paramd, *paramn, *paramv;
char step[120];
printf("content-type: text/html\n\n");
/* If using the GET method */
if (strcmp((char *)getenv("REQUEST_METHOD"), "GET") == 0)
{
paramd = (char *)strdup((char *)getenv("QUERY_STRING"));
getquery(paramd, &paramv);
while (paramv)
{
plustospace(paramv);
M86 S
U
G
ECURITY
SER
UIDE

Advertisement

Table of Contents
loading

This manual is also suitable for:

Web filter slWeb filter msa

Table of Contents