Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

A few random observations after having a cursory view on the download of your script (Form.cgi from Form.zip) which does "not work properly":

The original script is not your own, but you tried to adapt some form script "flying around" in the internet. (Which is not a bad thing as is, but just to mention because it was not obvious from your post.)

I didn't bother to long for the original of the script, but try to deduce your changes from what you wrote here.

You introduced the lines 631,632 (at beginning of sub send_email):

# Only send email if spam trapping field is empty # if ($Form{'hiddenfield'} eq '') {

and line 907,908:

# closing bracket for spam if statement # }

Now coming from here:

There is no such variable as %Form declared or filled anywhere, so it will be empty (referencing that stray variable is no error, since use strict; is not used in the script.)

The closing bracket for spam if statement is not placed at the end of the original sub send_email but a good while further below enclosing some additional subs.

The last 2 mentioned observations are errors IMHO. To correct that, I propose the following:

$Form{'hiddenfield'} should read $query->param('hiddenfield').

Move the closing bracket for spam if statement to approx. line 830, where the original sub send_email ended. (more precisely: place it in front of the } which precedes sub add_error.)


This is all untested guesswork, but I hope it may lead you closer to what you wanted.


In reply to Re: Battling form spam by pKai
in thread Battling form spam by rickaltman

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 contemplating the Monastery: (6)
As of 2024-04-18 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found