I have a form set up in PMWiki. The action sends it to a php script which takes the information and does several different actions. The php script needs to validate the information that comes from the PMWiki page. I know how to do all of that. However, if one of the fields doesn't validate, I want to reload the PMWiki page with all of the information still filled in, but with an error message. My first thought was to post all of the fields back to the starting page, but I can't make that work. I am open to any solution that allows me to continue to work with PMWiki as the base, which means that I can't do the form in a PHP page that is self validating (I've done that for other sites). And I don't want to serve up a separate form outside of PMWiki if it doesn't validate. Ideally, I'd like something like header('Location: mysite.com/MyPMWikiPage'); but that would be a post that could have all the fields sent back. Sorry if this seems so specific, but I know how to work around the problem, I want to learn how to solve this problem directly, unless that is not possible. PMwiki.org recommends server side validation, but I have been unable to find how to post back when it fails.
Asked
Active
Viewed 279 times
2
-
Does the PMWiki page actually have the logic in place to show an error message and repopulate form data? If not you will have to edit the page itself. Let me know, if so I can post a solution for you to get the data back to that page. – defines Jun 21 '09 at 14:12
-
Yes. I can get $_post and $_session vars (I don't want to use $_get). I am sending back the error message in a var, so it will show if it exists. – Doug Johnson-Cookloose Jun 22 '09 at 01:56
-
1Have you tried using FOX (Pmwiki Form processor): http://www.pmwiki.org/wiki/Cookbook/Fox – Jeroen Baert Apr 27 '12 at 13:36
-
@DougJohnson did you ever get this resolved? – Michael Paulukonis Jul 06 '13 at 20:37
1 Answers
0
Your custom form validation doesn't look very different from what PmWiki does while handling editing submission.
Starting from PmWiki/AvailableActions, you may have a look on how this is designed, and studying recipes code (such as Cookbook/HtpasswdForm), you'll see how others did.

Dfaure
- 564
- 7
- 26