csorensen has asked for the wisdom of the Perl Monks concerning the following question:
here's the code I have now .. with comments removed for space
use strict; use CGI; $sendmail = '/usr/lib/sendmail'; $file = param('file'); $formdata=<STDIN>; $formdata=~s/\s+$//; foreach (split(/&/, $formdata)) { ($name, $value)=split(/=/, $_); $name=~s/\+/ /g; $name=~s/%([0-9|A-F]{2})/pack(C,hex($1))/eg; $value=~s/\+/ /g; $value=~s/%([0-9|A-F]{2})/pack(C,hex($1))/eg; $formash{$name} = $value; } $receiver = $formash{email}; open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!"; print SENDMAIL "To: $receiver \n"; print SENDMAIL "From: info\@constellar.com \n"; print SENDMAIL "Subject: Whitepapers Request \n"; close(SENDMAIL);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extract data from a form .. and attach a file in sendmail
by KM (Priest) on Jun 30, 2000 at 21:52 UTC | |
|
Re: extract data from a form .. and attach a file in sendmail
by merlyn (Sage) on Jun 30, 2000 at 21:49 UTC | |
|
Re: extract data from a form .. and attach a file in sendmail
by csorensen (Beadle) on Jul 01, 2000 at 00:22 UTC | |
|
Re: extract data from a form .. and attach a file in sendmail
by chromatic (Archbishop) on Jul 01, 2000 at 04:34 UTC | |
by csorensen (Beadle) on Jul 01, 2000 at 07:21 UTC | |
|
Re: extract data from a form .. and attach a file in sendmail
by Anonymous Monk on Jul 02, 2000 at 02:18 UTC | |
|
Re: extract data from a form .. and attach a file in sendmail
by Anonymous Monk on Jul 01, 2000 at 05:39 UTC |