|
Cookbook /
Mailform3Summary: A single wiki page mail form with feedback
Version: 05 Aug 2007
Prerequisites: PmWiki 2.1.15+
Status: Stable
Maintainer: TonyColley
Categories: Forms
Questions answered by this recipeIs there a way to have a wiki page process a mail form (e.g. a Contact Me form) and report status / errors back on the same wiki page? DescriptionA single page mail form with feedback This "Contact Me" form uses a per-page configuration file (in First, to create a "Contact Me" form in Main, use something like this example Main.ContactMe.phpΔ script, and put it in the appropriate This script has the capability to block users from specific IP addresses from sending you emails. Defaultly, no IP addresses are blocked, you have to maintain that list within the script. To assist you, the IP address of the user is appended to the message they entered before the script sends the email to you. Next, create a NotesYou will probably want to make sure this page is password-protected or otherwise not freely available for the world to edit. Not that there is any security risk (since all the real work is done in the The script allows the user to use standard HTML tags to format the message. However, the script disables several tags (e.g. Release Notes03 Sep 2006 --- updated Main.ContactMe.php to enable specification of partial IP addresses to block. If the IP address in the BlackListIP array is "192.168.1." then any IP address beginning with 192.168.1. will be blocked. CommentsSept. 23, 2006 I love this recipe, and for the most part it works great, but I have run into a Spam problem. I receive the e-mails but they do not include the senders ip address as promised. The bottom of the e-mail reads: <hr>Sender's IP address: Please help! I am using the default configuration with version 2.1.26 of PmWiki. Profiles/MattKemple Thanks for this recipe, I love the inpage success message. I also solved the IP issue message.
On a Linux Apache system Have fun, Bart October 06, 2006, at 10:17 AM Bart, Thanks for the help this seems to have remedied the problem. -Matt Oct. 19, 2006 UPDATE 05 AUG 2007 I have uploaded a slightly modified version of the PHP file which takes care of the REMOTE_ADDR problem. TonyColley Hello, well, I tried mailform, 1, 2, 3, and I am not completely satisfied... I can't code in php, so if somebody can help me and contribute for the community with a mailform4 it should be fine!-) What I would like is: a mailform4.php which allows to create a free form with as much form fields as needed. By example, if the user needs 3 fields or 10 fields mailform4 will take in account these 3 or 10 fields and send all the informations to the mailformaddress. I give an example of php script which does what I describe above and works fine in html context (but don't in wiki context). If this can inspire the future contributor... Thanks!!!
If this script can manage too hidden variables (for sending informations about the origin and purpose of the form), and if a simple test can block the sending when a field is empty, all should be great! How can one add more message fields, e.g. for a support-request form (Message-detail, Message-options, etc)? Thanks, JanBrejcha Adding a Spam bot protection using PM's Captcha receipe I like this mailform a lot. When I found PM's Captcha receipe I thought that it would be nice to use it in this mailform, which can be done easily in a few steps: else if (!IsCaptcha()) {
$msg = "Empty or wrong code. ";
$snt = "false";
$frm = "true";
}
and in the Main.ContactMe.txt you replace line 29
But I have also a question: Is it possible to keep the message text? When I hit the send button and the mail was for some reason not sent, the name and the mailadress I typed reappear in their forms, but the message form is empty. FH February 14, 2008, at 06:09 AM See AlsoContributorsTonyColley August 31, 2006, at 03:57 PM (created) |