PmForm /
PmForm
This group is used to document the Cookbook:PmForm recipe.
From PmWiki 2.3.22, the script and the template pages are included in the core, you don't need to download it separately. It is not enabled by default, you still need to enable and configure it, see below.
There are several steps for PmForm to work.
- For PmWiki 2.3.22 or more recent:
- Modify your
local/config.php
or other local customization file, enabling PmForminclude_once("
$FarmD
/scripts/pmform.php");
- Modify your
- For PmWiki 2.3.21 or older:
- Download pmform.zip and extract it to your PmWiki directory on your server
- Modify your
local/config.php
or other local customization file, enabling PmForminclude_once("
$FarmD
/cookbook/pmform.php");
- add a line in your
config.php
file to define the reference for every unique(:pmform reference:)
directive:$PmForm['reference'] = 'subject="Email from '.$WikiTitle.'" mailto=yourname@example.com form=#yourform fmt=#yourformpost from=myname@myexample.com';
- Create wiki page called
Site.LocalTemplates
if it doesn't exist already - Modify
Site.LocalTemplates
, editing the form code creating the form (named #yourform from the config.php line above) and the output format (named #yourformpost from theconfig.php
line above) - Inserting the
(:pmform reference:)
directive into any wiki page where you want this specific form
If your wiki is sending you email forms with international characters, and the character encoding of the emails is wrong, you may also want to add the following to config.php:
# Fix for Subject header, if international characters: $EnablePmFormMailSubjectEncode = 1; # Fix for message body: $PmFormMailHeaders = "Content-Type: text/plain; charset=utf-8\r\n";
Starting points:
- Basic Email Form - a walkthrough creating a basic email form with honeypot & captcha (by Xes)
- MailForm - forms for sending electronic mail
- GDPR MailForm - forms for sending electronic mail, GDPR compliant
- HoneyPot - filter posts from robots
- Comments - Add comments to current page, or a comment page
- GDPR Comments - Add comments to current page, or a comment page, GDPR compliant
- Data Forms - Add data to pages
Unofficial user's notes about PmForms:
- FormDirectives - directives useful when building a form
- FmtDirectives - directives useful when post-processing a form
- ProcessingDescription - sketch of the algorithm used when rendering and processing a form
- Forms related pages
Notes
You need to put pmform.php
direct into your cookbook/
directory, and Site.PmFormTemplates
into your wikilib.d
directory.
- Xes: I don't recommend putting
Site.PmFormTemplates
directly inwikilib.d
because that's part of the upgrade tree and should not be modified by users or recipes. I created my ownxeslib.d
directory and putSite.PmFormTemplates
into it, adding this as the very FIRST line in myconfig.php
:$WikiLibDirs = array(&$WikiDir,new PageStore('$FarmD/xeslib.d/{$FullName}'),new PageStore('$FarmD/wikilib.d/{$FullName}'));
This is how you can create your own lib (library) directory ("lib.d") name for wiki page templates separate from user-overwritten wiki.d files. - ChrisK: Any installation of files into
wikilib.d
also runs into issues with using WikiFarms where thewikilib.d
directory may not have permissions allowing it to be written to. It thus seems reasonable to move theSite.PmFormTemplates
file to thewiki.d
directory.
All relevant pages in the PmForm group:
- Basic Email Form with Honeypot & Captcha
- Client-Alice
- Client-AliceAdams
- Client-JoesPizza
- Client-Pm
- ClientForm
- ClientTemplates
- Comments
- DataForms Using PmForm to save data on wiki pages
- FmtDirectives
- FormDirectives
- GDPR Comments
- GDPR MailForm
- HoneyPot Implementing "honeypots" for spam-control in forms
- MailForm Using PmForm to send electronic mail from a form in a page
- PITS-NewIssue
- PITSTemplates
- ProcessingDescription
- RSVPList
- SideBar
- Variables
Category: Forms