Title: my_cforms_logic makes Multi-PartForms loop
Last modified: August 31, 2016

---

# my_cforms_logic makes Multi-PartForms loop

 *  Resolved [stutzd](https://wordpress.org/support/users/stutzd/)
 * (@stutzd)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/my_cforms_logic-makes-multi-partforms-loop/)
 * what I’m trying to do:
    ask the user if they are a member on form A, if they 
   are a member then go to form B, or if they are not a member then go to form C.
 * Problem: I am able to have the user go to correct form, When the user clicks 
   submit on the 2nd and last form it goes back to the first form, instead of the
   success page, so loops are form A to form B back to form A… or form A to form
   C back to form A…
 * Additional info: when i deactivate cforms2-my-functions plugin the forms are 
   able to go to their correct success pages upon submission. Also I have both form
   A and form B as the last form of the Multi-Part Forms.
    [new form test](http://rexburgtrack.org/new-meet-test/)
 * The code below is the code I have in the cforms2-my-functions plugin.
    Thanks
   for any help you may offer.
 *     ```
       <?php
       /*
        * Plugin Name: cforms2-my-functions
        * Description: Find below examples for your custom routines. Do not change the function names.
        */
   
       ###
       ### my_cforms_logic() : gets triggered throughout cforms, supporting real-time configuration
       ###
       ### my_cforms_action() : gets triggered just before sending the admin email
       ###
       ### my_cforms_filter() : after validation, before processing/saving input data (nonAJAX)
       ###                      or in case you'd like to manipulate / check user input before further processing
       ###
       ### my_cforms_ajax_filter() : after validation, before processing/saving input data (AJAX)
       ###
   
       ### TO USE THE FUNCTIOS:
       ###  1) copy this file to your plugin directory
       ###  2) rename it ending with extension *.php
       ###  3) remove the functions you do not need and customize the needed ones
       ###  4) activate this plugin
   
       ###
       ### Your custom application logic features
       ###
       ### "successMessage" 				$cformsdata = cforms datablock
       ### "redirection"  					$cformsdata = cforms datablock
       ### "filename"     					$cformsdata = $_REQUEST
       ### "fileDestination" 				$cformsdata = $oldvalue = array!
       ### "fileDestinationTrackingPage" 	$cformsdata = all SQL data, $oldvalue = array!
       ### "adminTO"  	  					$cformsdata = cforms datablock
       ### "nextForm"    					$cformsdata = cforms datablock
       ###
       ### "adminEmailTXT"					$cformsdata = cforms datablock
       ### "adminEmailHTML"				$cformsdata = cforms datablock
       ### "autoConfTXT"					$cformsdata = cforms datablock
       ### "autoConfHTML" 					$cformsdata = cforms datablock
       ### "adminEmailSUBJ"				$cformsdata = cforms datablock
       ### "autoConfSUBJ"					$cformsdata = cforms datablock
   
       function my_cforms_logic($cformsdata,$oldvalue,$setting) {
       $userfield = $cformsdata['data'][$cformsdata['data']['$$$membership']];
           if ( $setting == "nextForm" ){
       	if($oldvalue == '9' && $userfield == 'yes'){
       		$change =2;
       	}
   
       	if($oldvalue == '9' && $userfield == 'no'){
       		$change =9;
       	}
       }
       return $change;
       }
       ?>
       ```
   
 * [https://wordpress.org/plugins/cforms2/](https://wordpress.org/plugins/cforms2/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [bgermann](https://wordpress.org/support/users/bgermann/)
 * (@bgermann)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/my_cforms_logic-makes-multi-partforms-loop/#post-6910932)
 * Do you still experience this issue with the latest version?

Viewing 1 replies (of 1 total)

The topic ‘my_cforms_logic makes Multi-PartForms loop’ is closed to new replies.

 * ![](https://ps.w.org/cforms2/assets/icon-128x128.png?rev=1010031)
 * [cformsII](https://wordpress.org/plugins/cforms2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cforms2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cforms2/)
 * [Active Topics](https://wordpress.org/support/plugin/cforms2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cforms2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cforms2/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [bgermann](https://wordpress.org/support/users/bgermann/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/my_cforms_logic-makes-multi-partforms-loop/#post-6910932)
 * Status: resolved