#!/usr/bin/perl ########################################## ### confirm.pl ### 11/1/99 ### ### Generates a confirmation page based ### on a user's form input. ### ### Porter Glendinning ### porter@cerebellion.com ########################################## ########################################## ### Settings ############################# ########################################## $processScriptURL = "process.cgi"; ########################################## ### Main ################################# ########################################## &ParseInput; &PrintConfirmation; exit(0); ########################################## ### Subprocesses ######################### ########################################## sub ParseInput { ### Get the input from the query string (method=GET) if there is one, ### and from STDIN (method=POST) if there isn't. if ($ENV{'QUERY_STRING'}) { $buffer = $ENV{'QUERY_STRING'}; } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } ### Split the pairs and assign them to the %FORM hash. @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; } } sub PrintConfirmation { ### Print the page header and first part of the content. print<<"ENDOFPRINT"; Content-type: text/html
OK, $FORM{'firstName'}. Are you really, really sure you want to submit that information?
ENDOFPRINT }