Cgi Written In Perl; Embed Data In Query String - M86 Security Web Filter HL User Manual

Table of Contents

Advertisement

CGI written in Perl

There are two methods for CGI written in Perl: One lets you
embed data in the query string to pass data to the Options
CGI, and the other lets you use Java Script to post form data
to the Options CGI.

Embed data in query string

#!/usr/bin/perl
# Original Filename: cusp_block1.cgi
# File Type:
# Description:
page
# Replace the <Web Filter IP> with the real IP before using.
# This script provide data to the options CGI through query string
# Revision:
# Date: 03/08/2004
$method = $ENV{'REQUEST_METHOD'};
if ($method=~ /post/i) {
} else {
}
$url = $1 if ($string =~ /URL=(\S+)&IP=/i);
$ip = $1 if ($string =~ /IP=(\S+)&CAT=/i);
$cat = $1 if ($string =~ /CAT=(\S+)&USER=/i);
$user = $1 if ($string =~ /USER=(\S+)/i);
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "</head>\n";
print "<body>\n";
print "<br>Web Filter Customized Block Page (CGI written with
Perl)<br>\n";
print "URL: $url<br>\n";
print "IP: $ip<br>\n";
print "CAT: $cat<br>\n";
print "USER: $user<br>\n";
M86 S
U
G
ECURITY
SER
UIDE
CGI
Sample Perl script for Web Filter customized block
1
$string = <STDIN>;
$string= $ENV{"QUERY_STRING"};
A
S
PPENDICES
ECTION
A
B
PPENDIX
435

Advertisement

Table of Contents
loading

This manual is also suitable for:

Web filter slWeb filter msa

Table of Contents