Title: Connecting WPforms to php code using code snippet
Last modified: November 13, 2024

---

# Connecting WPforms to php code using code snippet

 *  Resolved [asamaras](https://wordpress.org/support/users/asamaras/)
 * (@asamaras)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/connecting-wpforms-to-php-code-using-code-snippet/)
 * Hello, I want to connect the result of form, to pass it to an API, and then display
   the result of the API. In order to do this, I have a 3 steps plan :
    1. Create a form with WPforms and note its ID
    2. Write the php code with the snippet plugin code that gather WP form data, make
       an api call and display it
    3. Instantiate the WPform on my page, and paste in the following block the snippet
       code so that it is evaluated
 * First, for testing purpose I only want to display the result of the form so I
   wrote the following code :
 *     ```wp-block-code
       function be_crm_display_raw_form_data( $fields, $entry, $form_data, $entry_id ) {    echo "<pre>";    print_r( $fields );    echo "</pre>";}add_action( 'wpforms_process_complete', 'be_crm_display_raw_form_data', 10, 4 );
       ```
   
 * But after filling the form on preview page and hitting submit, nothing shows 
   up. Can you please point to me what I am doing wrong. 
   Thanks in advance for 
   your answer

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Shawon Chowdhury](https://wordpress.org/support/users/shawon001/)
 * (@shawon001)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/connecting-wpforms-to-php-code-using-code-snippet/#post-18139390)
 * Hi [@asamaras](https://wordpress.org/support/users/asamaras/) ,
   Thanks for reaching
   out!The code should work however printing values on the page with this action
   will affect AJAX form submission.Could you please disable [AJAX form submission](https://wpforms.com/docs/how-to-enable-ajax-form-submissions/#Enabling_AJAX_Form_Submissions)
   for this form and see how it goes? Thanks 🙂
 *  Thread Starter [asamaras](https://wordpress.org/support/users/asamaras/)
 * (@asamaras)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/connecting-wpforms-to-php-code-using-code-snippet/#post-18141086)
 * Thank you for your answer,
    I disabled AJAX form submission on the relevant form,
   unfortunately it stills does not show any result.
 *  Plugin Support [Shawon Chowdhury](https://wordpress.org/support/users/shawon001/)
 * (@shawon001)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/connecting-wpforms-to-php-code-using-code-snippet/#post-18149188)
 * Hello [@asamaras](https://wordpress.org/support/users/asamaras/) ,
   That’s unfortunate!
   I just did a test on my end and created a screencast for you [here](https://a.supportally.com/v/SoM4p8).
   As you can see, it’s working fine without any issues when the AJAX submission
   is disabled. Please try again after clearing the browser’s cache, and see if 
   that helps. Thanks 🙂
 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/connecting-wpforms-to-php-code-using-code-snippet/#post-18155077)
 * Hi [@asamaras](https://wordpress.org/support/users/asamaras/),
 * We haven’t heard back from you in a few days, so I hope the screencast and details
   provided above have helped you resolve the issue.
 * I’m going to go ahead and close this thread for now. But if you’d like us to 
   assist further, please feel welcome to continue the conversation.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Connecting WPforms to php code using code snippet’ is closed to new replies.

 * ![](https://ps.w.org/wpforms-lite/assets/icon.svg?rev=3254748)
 * [WPForms - Easy Form Builder for WordPress - Contact Forms, Payment Forms, Surveys, & More](https://wordpress.org/plugins/wpforms-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpforms-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpforms-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpforms-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpforms-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpforms-lite/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/connecting-wpforms-to-php-code-using-code-snippet/#post-18155077)
 * Status: resolved