Hello all :)
I am new O_O
I'm using a bare-bones CGI web form mailer, which is quite open to abuse in its current incarnation. I'd like to add a few lines to the script that will limit people to one submission once every $TIME. I'd perhaps like to limit the length of submissions, but that's less important -- I don't care so much if "War and Peace" is sent to me, just as long as it's not sent 10,000 times :)
Also, if I just limit the number of submissions, it's easier for me to understand (perl newbie).
Here is my junk:
#!/usr/bin/perl
use CGI;
my $query = new CGI;
print $query->header ( );
my $comments = $query->param("comments");
open ( MAIL, "| /usr/sbin/sendmail -t" );
print MAIL "To: melissa\@secretemail.com\n";
print MAIL "Subject: Form Submission\n\n";
print MAIL "$comments\n";
print MAIL "\n.\n";
close ( MAIL );
# barf out html message
print <<END_HTML;
<html>
<p>thanks! This is what you sent me:</p>
$comments
</html>
END_HTML
Thanks in advance!
--
m j teigen
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.