in reply to form help
#!/usr/bin/perl require "/web/cgi-bin/cgi-lib.pl"; &ReadParse; ### get values from html form input called email & fax $fax = $in{'fax'}; $email = $in{'email'}; $err[1] = "Please fill in all the required fields"; $domain = "your.domain.com"; ########## did they enter something? &error($err[1]) if !( $fax || $email ); &mail exit; sub error { print "Content-type: text/html\n\n"; print "<HTML><HEAD></HEAD><BODY>\n"; print "<H3>$_[0]</H3><BR>\n"; print "</BODY></HTML>\n"; exit 0; } ########## use sendmail sub mail { open (MAIL,"|/usr/lib/sendmail Me\@$domain"); print MAIL "From: script@domain.com\n"; print MAIL "To: Me\@$domain\n\n"; print MAIL "Users Fax:$fax\n"; print MAIL "Users Email:$email\n"; close MAIL; return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: form help
by chromatic (Archbishop) on Aug 13, 2001 at 22:18 UTC |