#!/usr/bin/perl ################### use CGI ':standard'; use CGI qw(:standard); # then only CGI.pm defines a head() $page = param('page'); #/cgi-bin/edit.cgi?page=edit print header(); if ($page eq 'edit') { #This part creates a form with the content from the edit.shtml file. use LWP::Simple; $content = get ('http://www.domain.com/edit.shtml'); print <Test

EOM } else { $database = "/home/site139/public_html/edit.shtml"; # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } { #Here I delete the edit.shtml page. open my $empty_the_file, "> /home/site139/public_html/edit.shtml" or die "Can not write file: edit.shtml $!" ; close $empty_the_file; #Here I try to put in the data from the form but $FORM{'content2'} doesn't get registered. open (DATABASE,">>$database"); print DATABASE "$FORM{'content2'}\n"; close(DATABASE); } print < Page edited.

$FORM{'content2'} EOM exit; }