#!/usr/bin/perl 
require "cgi-lib.pl";

$myfile = "/home/simon/testfile";

if (&ReadParse) {
  &ReadParse(*input);

system "echo $input{'site'} >> $myfile";
open (FP,"<$myfile");
@tp=<FP>;
close FP;

  print &PrintHeader;
  print "<HTML><HEAD><TITLE>Squid Block</TITLE></HEAD><BODY>";
  print "The current block list: ";
  print "<BR><P>"; 
     if (@tp) {
     print "<PRE>",@tp,"\n\n </PRE>";
     }
     else {
     print "Not found!";
     }
}
else {
  print &PrintHeader;
  print "<HTML><HEAD><TITLE>Input site to block</TITLE></HEAD><BODY>";
  print "<form>Site to block: <input name='site'>";
  print "<input type=submit value='Go'></form>";
}
  print &HtmlBot;

