#! /usr/bin/perl
# Written by: R. Krishnan
#       Date: November 23, 1994
print "Content-type: text/html\n\n"; #inform server what's comming
read(STDIN,$buffer, $ENV{'CONTENT_LENGTH'}); # get the variable=value pairs
@pairs = split(/&/, $buffer); # split multiple pairs to an array
foreach $pair (@pairs) 
{ # need to split each variable=value pair into $name and $value
 ($name, $value) = split(/=/, $pair);
 $value =~ tr/+/ /;
 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
#Introduce an array called FORM to capture all relevant information in 
# form
$FORM{$name} = $value;
 }
# >> opens file in append mode
open (THE_FILE, ">>address.html");
# For now I am only writing these variables out with a 
# comma delimiter
print THE_FILE "$FORM{'UserName'}, $FORM{'PassWord'}\n";
close(THE_FILE);
print "<HEAD><TITLE>Registering with DDN</TITLE>\n";
print "</HEAD><BODY>\n";
print "<H1>The following record has been added to the register</H1>\n";
print "<B>$FORM{'UserName'},$FORM{'PassWord'}</B><p>\n";






