I don't know how many users of formmail have trouble with spammers but I have and it is annoying. The message is usually something like this:
messagetype: 'Suggestion'
Comments: 'a'
username: '163Öá³ÐÍø'
useremail: 'abc@hot.com'
usertel: 'abc'
userfax: 'abc'
I received this within 24 hours of publishing the page with the new form. The bots look for the "action" attribute in the form, javascript verification does not work so here is my solution:
Step 1: Put the form code in a file with 'formname.php' name and place the file in a separate directory ./includeforms.
On the page where the form resides, use a php include to place the code.
e.g. <?php include "./includeforms/formname.php"; ?>
Step 2: Code the <form ... > element within a php command as follows:
<?php echo '<form method="POST"' . $act . 'onsubmit="" name="My Form">' ?>
Step 3: Define the $act variable at the top of the page using the form before the document type and <html> tag as follows:
$act = ' action="http://www.yourdomain.com/mailscript.php" ';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This solution requires a user to actually open the page in a web browser for the server side code to include the form on the page and instantiate the "action" attribute.
If anyone else has better solutions, let me know.
Ben


Reply With Quote
Bookmarks