Differences

This shows you the differences between two versions of the page.

english:phpwcms-system:article:contentparts:form:special-applications:cp-after-form-input [2009/09/17 08:21]
Claus
english:phpwcms-system:article:contentparts:form:special-applications:cp-after-form-input [2018/06/03 18:09] (current)
Line 12: Line 12:
-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. +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:
-We can achieve however with the assistance of a PHP script, which uses a new function, our goal. (Available since release r282).+**Demonstrated here by the example of a simple form with a downstream CP:** 
 +  * Completing the form 
 +  * Sending the form 
 +  * Automatic call of CPs
-This function can read, change and return all form inputs. It puts itself temporally between the action submit and to dispatching the email.+**The address of the CPs is not visible from outside.** 
 + 
 +\\ 
 + 
 +===== Solution 1: ===== 
 + 
 +**Condition:**  -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/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: 
 +<code php>[PHP]echo showSelectedContent('CP,2');[/PHP]</code> 
 + 
 +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)//.
Line 26: Line 55:
</note> </note>
-**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.** 
Line 46: Line 69:
\\ \\
 +===== 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
 +
 +<code php|h my_form_do_it.php |h>
 +<?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}';
 +}
 +
 +?>
 +</code>
 +
 +\\
---- ----
---- ----
Line 86: Line 135:
-\\ 
-~~UP~~ 
-===== 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 
- 
-<code 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}'; 
-} 
- 
-?> 
-</code> 
   
english/phpwcms-system/article/contentparts/form/special-applications/cp-after-form-input.1253168502.txt.gz · Last modified: 2018/06/03 18:07 (external edit)
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