Re: apache and forms
On Mon, 21 Jul 1997, Mikko Väkiparta wrote:
> Im trying to make www-registration system. I'd like to get it work this
> way:
> 1. I fill out the form
> 2. I press the submit-button and apache sends it via email to my mailbox
> 3. Apache says something and throw me on the downloadpage
>
> I think I must use perl or CGI and I have tried everything, but I can't
> get it work. If someone can send me example files about sending forms
> via e-mail (both files, html and cgi or perl) and installation
> instructions, that makes me really happy.
CGI is not a language. It is, as the name implies, and interface. Now
that we're wildly off-topic, let's digress some more. :-)
perl is a language. Here's a script.
#!/usr/bin/perl -Tw
$mail = '/usr/sbin/sendmail -t';
$recip = 'you@yoursite.com';
$dlpage = '/path/to/your/page.html';
use CGI;
$load = new CGI;
open(MAIL, "| $mail") or die "No $mail here\n";
print MAIL "To: $recip\n";
print MAIL "Subject: Download from $ENV{REMOTE_HOST}\n\n";
print MAIL "$load->param('name')\n";
print MAIL "$load->param('email')\n";
print MAIL "$load->param('comments')\n";
close(MAIL);
print $load->header;
open(H, $dlpage) or die "no $dlpage here.\n";
while (<H>){ print; }
close(H);
Make sure you've installed a web server, perl, and the CGI modules. I
don't guarantee the above will work, since it's off the top of my head,
but I don't see any reason for it not to work. Oh, name, email and
comments should be fields in your HTML form. Enjoy.
Jason Costomiris | Finger for PGP 2.6.2 Public Key
jcostom@sjis.com | "There is a fine line between idiocy
My employers like me, but not | and genius. We aim to erase that line"
enough to let me speak for them. | --Unknown
http://www.jasons.org/~jcostom
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: