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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|