Questions answered by this recipe
- How can I create a form in PmWiki to send mail?
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.
Documentation and examples for PmForm are being performed in a separate wiki group at PmForm. Some key pages:
PmForm blocks directives from data being saved to pages by converting markups: thus "(:" becomes "( :" and ":)" becomes ": )". These are managed by the $PmFormPostPatterns array.
(:template require:) directive can be used to
prevent certain string combinations from appearing in
posted fields. For example, to prevent someone from
entering link markups, use:
(:template require text match=-[[ errmsg="links not allowed":)
which says that the 'text' field must not contain "[[".
The recipe requires pmwiki-2.2.56 or later.
- 20230405 - added to core for version 2.3.22 - see PmWiki:ChangeLog for any updates after that date.
- 20221123 - updates for PHP 8.2.
- 20221104 - remove PHSC() definition (already exists in 2.2.56).
- 20221031 - fix for PHP 8.2.
- 20221024 - Add $PmFormMailFn (default "mail"), add
where=below#anchor, update for PHP 8.2.
- 20210522 - update recipe for PHP 8 compatibility (warning reported by Dfaure).
- 20180906 - update recipe for PHP 7.2 compatibility.
- 20140212 - add $EnablePmFormUpdateReverse.
- 20140103 - update recipe for PHP 5.5 compatibility.
- 20140101 - update recipe for PHP 5.5 compatibility.
- 20130413 - replace htmlspecialchars() with PHSC() for better PHP5.4 compatibility; update change summary if a 'csum' form field is posted.
- 20120901 - fixed typo.
- 20110216 - added variable $EnablePmFormMailSubjectEncode (PITS:01238).
- 20100904 - added $PmFormExitFunction, $PmFormRedirectFunction (PITS:01179), fixed carriage returns (PITS:01175).
Your comments are welcome.