|post.txt||Form Processor (source code)|
|mail.txt||Form-To-Mail CGI (source code)|
Here's how. In your CGI, just open the HTML file, read it, then print it back out:
open(INF,"Thanks.html"); @thanks = <INF>; close(INF); print "Content-type:text/html\n\n"; print @thanks;
How can I make my form-to-mail CGI print the variables to the email in the same order they were entered on the form?
You'll find that if you use the above form-to-mail CGI, which does a
foreach $key (keys(%FORM)) to print the form values, you'll
get the values in random order. To print them in the order they
appear on the form, you can add this line to the form-decoding block:
push(@keys, $name);Then you'll change your foreach line to
foreach $key (@keys).
Here is the full source code showing how to do this:
|mail2.txt||Form-To-Mail CGI (source code) (sorted output)|