Form processing

bandicoot3141
bandicoot3141 used Ask the Experts™
on
Is there an easy way to process an emailed HTML form so that it's easier to read? I work for a law firm, and we need to process a form that clients email to use from our web site. The form uses a mailto: command.

Cheers...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
the mailto: command does send the email but it sends the body as a URL string and is really ugly.  If you use ASP or Perl or ColdFusion you can easily create the email to be readable and pleasing.  Which programming language are you going to use?
If you use Perl

#!/usr/local/bin/perl
use strict;
use CGI ':standard';
my ($to, $from, $subject, $contents);

print "Content-type:text/html\n\n";

$to = param('to');
$from = param('from');
$subject = param('subject');
$contents = param('contents');

open(MAIL, "|/usr/lib/sendmail -t") || Error ('open', 'mail program');

print MAIL "To: $to \nFrom: $from\n";
print MAIL "Subject: $subject\n";
print MAIL "$contents\n";

close(MAIL);

print "Thanks for your comments.";

sub Error {
    print "The server can't $_[0] the $_[1]: $! \n";
    exit;
}


# This assumes you have an HTML form with the 4 form values and a server with sendmail configured.

bW
ASP is similar, let us know
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Author

Commented:
That's a great example; just what I was looking for. But I've never programmed in PERL (I'm just a beginner)...does it need a compiler, or can it be run in a browser or something?

Commented:
All of those scripts need to be run on your webserver machine, which will process what the user submits via a usual (not mailto:) form, and take appropriate steps.

To answer your second question, your webserver brand (Apache, IIS, any other?) must be known, as well as your webserver machine itself - is it Windows(which Windows?), Unix , Mac?

Commented:
All of those scripts need to be run on your webserver machine, which will process what the user submits via a usual (not mailto:) form, and take appropriate steps.

To answer your second question, your webserver brand (Apache, IIS, any other?) must be known, as well as your webserver machine itself - is it Windows(which Windows?), Unix , Mac?
Well bandicoot I do hope you decide to use/learn Perl.  Its a great language for the web and other applications.  If your looking for a good CGI book to start out with I recomend "Perl and CGI for the World Wide Web" by Elizabeth Castro.  She makes CGI easy, but to really get good you should get Learning Perl or another O'Reilly book.  Also note that the first line #!... is unique to the perl directory on the server the script runs.

bW
You need a webserver to receive the information typed in by clients.  What type of server do you have?

Commented:
This is off at a tangent, but have you considered using a PDF for the form instead of an HTML page? As long as the person viewing your website has Acrobat Reader v4 or above, the form will open in their web browser and they can fill it out on-screen.

You can add a submit button to the form that makes it send the form data to a mailto URL (or any other URL for that matter). The nice thing is that you have the option of sending it as a .FDF (forms data format).

When the .FDF appears in your email inbox, all you have to do is double click on it. When it opens (in Acrobat or Acrobat Reader) it will load up the original PDF (there's a reference to it inside the FDF file) and fill in the form fields with the data the user entered.

This is a very nice bit of Acrobat technology which isn't very well known. You need the full version of Acrobat to create the form, but not to fill it in or to view the filled-in data. There's absolutely no programming involved in any of this.
Top Expert 2013

Commented:
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
Top Expert 2013

Commented:
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to willman023

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial