#!/usr/bin/perl print "Content-type:text/html\n\n"; $diskuse = (system `/usr/bin/df -k`); read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @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; } # Since the "how you reached this site" list was saved as # a number, we need a hash to translate it back to English: %howreach = ( 0 => "", 1 => "$diskuse", 2 => "Site is bookmarked", 3 => "A search engine", 4 => "A link from another site", 5 => "From a book", 6 => "Other" ); print <Results

Results

Here's what you entered:

Your name: $FORM{'name'}

Email: $FORM{'email'}

Which option you picked: $howreach{$FORM{'howreach'}}

How you'd rate this site (1=poor,5=excellent): $FORM{'rating'}

EndHTML %boxes = ( "des" => "Website Design", "svr" => "Web Server Administration", "com" => "Electronic Commerce", "mkt" => "Web Marketing/Advertising", "edu" => "Web-Related Education" ); print "You're also involved in the following:
\n"; foreach $key (keys %boxes) { if ($FORM{$key} == 1) { print "$boxes{$key}
\n"; } } print < Your comments:
$FORM{'comments'}

EndFoot