Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Limit submissions over time? by deadbarnacle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-29 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found