Strict Standards: Declaration of action_plugin_dlcount::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/dlcount/action.php on line 14

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/indexmenu/action.php on line 169

Strict Standards: Declaration of action_plugin_ipban::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/ipban/action.php on line 67

Strict Standards: Declaration of action_plugin_loglog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/loglog/action.php on line 82

Strict Standards: Declaration of action_plugin_navi::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/navi/action.php on line 46

Strict Standards: Declaration of action_plugin_uparrow::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/uparrow/action.php on line 69

Strict Standards: Declaration of action_plugin_userspagecreate::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/userspagecreate/action.php on line 97

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /home/www/wiki/inc/cache.php on line 289

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/auth.php on line 312

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/actions.php on line 154
CP after form input [phpwcms-HowTo:wiki]

Strict Standards: Declaration of syntax_plugin_code::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/code/syntax.php on line 41

Strict Standards: Declaration of syntax_plugin_tip::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/tip/syntax.php on line 38

CP after form input

Certain content parts only deliver after filling out and sending a form.

FIXME better translate and [en]-images

There are some applications, with which only a form must be filled out before certain content parts for the site visitor to become available. A Login is not needed for it.

In the field “on success” the tag {SHOW_CONTENT:CP,XX} is registered, with which the CPs after mailing the form are represented. In this field {tags} cannot be registered directly, since a safety mechanism removes all {tags}.

There are two solutions:

Demonstrated here by the example of a simple form with a downstream CP:

  • Completing the form
  • Sending the form
  • Automatic call of CPs

The address of the CPs is not visible from outside.


Solution 1:

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_cntPHP_rt'] = 1;


For the field “on success” we'll make use of the [PHP] tag by inserting the direct function call of the tag {SHOW_CONTENT}. The [tags] in square brackets are permitted :-?

For reloading the CP with the ID=2 we would write:

[PHP]echo showSelectedContent('CP,2');[/PHP]

That´s it, the CP ID=2 is loading after the form is filled in.


Solution 2:

However- we can achieve our goal with the assistance of a PHP script useing a new function. (Available since release r282).

This function can read, change and return all form inputs. It temporally puts itself between the submit action and the dispatching of the email.

The function call must be registered in the field like “PHP function:” below “recipient - template:“. (See picture below).

The entered data are changed with a function in the folder /frontend_init/.
Have a look: RT available in form generated E-Mail (Available since r282)

Docu: –
Forum: Galerie mit Formular verbinden[DE]

Autor: K.Heermann (flip-flop) (16.09.09)
CMS-Version: >= V1.4.1 r282
Version: V1.0 16.09.09

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_init'] = 1;


The script

in template/inc_sript/frontend_init/my_form_do_it.php

Here is an example of calling the content part with the ID=2

my_form_do_it.php

<?php
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
  if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -------------------------------------------------------------------------------------------
 
// Simple script for calling a CP from a form, after the submit
 
 
function my_form_do_it( &$postvar, &$form, &$mail ) {
 
    $form['onsuccess'] .= '{SHOW_CONTENT:CP,2}';
}
 
?>




Frontend:

The form:

example.com/r366/index.php?kategorie01

The result:

example.com/r366/index.php?kategorie01#jumpForm1


Backend:

The CP "plain text":

- As an example for any other CP. (In a hidden area stored).

Simple form:

english/phpwcms-system/article/contentparts/form/special-applications/cp-after-form-input.txt · Last modified: 2010/01/23 18:32 by Claus
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 79