
chrisabrooks
Novice
Nov 25, 2000, 3:17 AM
Post #2 of 2
(697 views)
|
Think this is what you are looking for: ############################################# #!/usr/bin/perl &GetFormInput; $redirect = $field{redirect}; $recipient = $field{recipient}; $email = $field{email}; $Day = $field{Day}; $Month = $field{Month}; $Year = $field{Year}; $Name = $field{Name}; $Address = $field{Address}; $StartMonth = $field{StartMonth}; $StartDay = $field{StartDay}; $StartYear = $field{StartYear}; $TotalAmount = $field{TotalAmount}; $Deposit = $field{Deposit}; $Balance = $field{Balance}; $Signature = $field{Signature}; $SignatureTitle = $field{SignatureTitle}; $SignatureMonth = $field{SignatureMonth}; $SignatureDay = $field{SignatureDay}; $SignatureYear = $field{SignatureYear}; print <<END; Content-type: text/html\n\n INSERT HTML HERE END ; sub GetFormInput { (*fval) = @_ if @_ ; local ($buf); if ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN,$buf,$ENV{'CONTENT_LENGTH'}); } else { $buf=$ENV{'QUERY_STRING'}; } if ($buf eq "") { return 0 ; } else { @fval=split(/&/,$buf); foreach $i (0 .. $#fval){ ($name,$val)=split (/=/,$fval[$i],2); $val=~tr/+/ /; $val=~ s/%(..)/pack("c",hex($1))/ge; $name=~tr/+/ /; $name=~ s/%(..)/pack("c",hex($1))/ge; if (!defined($field{$name})) { $field{$name}=$val; } else { $field{$name} .= ",$val"; #if you want multi-selects to goto into an array change to: #$field{$name} .= "\0$val"; } } } return 1; } ############################################# I haven't tested it, but it should work. All you need to do is to re-type the contract where I've put "Insert HTML here", and put the variables in place of the text boxes/pulldown menus. e.g: I, $name agree to blah blah blah on the $Day's of the $Month whatever... HTH, ------------------ My Little Webring The Best Of All That Is British chris.a.brooks@lycos.com Cult Forums - Cult CGI forum Linux - Join the revolution!!!
|