Title: Happy Forms API
Last modified: April 9, 2024

---

# Happy Forms API

 *  [sarge2236](https://wordpress.org/support/users/sarge2236/)
 * (@sarge2236)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/happy-forms-api/)
 * How to intercept the form’s submit button using Happy Forms API and redirect 
   the form to submit the details to custom PHP script that I created and saved 
   in my website directory?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhappy-forms-api%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Harries Happyforms](https://wordpress.org/support/users/happyformsharries/)
 * (@happyformsharries)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/happy-forms-api/#post-18023067)
 * Hey there Sarge,
 * You can add the snippet in your theme’s functions.php fill. To send data to another
   server. You’ll need to include a logic inside the action hook, like using **wp_remote_post**
   to send the submission variable to your other sever and process it there. Here’s
   an example snippet below:
 *     ```wp-block-code
       add_action( 'happyforms_submission_success', function( $submission, $form ) {    // $submission is an array of field_id => field value;    // $form is an array of form data, as configured in your builder    // Do the logic to save data into your database.wp_remote_post( 'https://otherserver.url', array(        'body' => $submission,    ) );}, 99, 2 );
       ```
   
 * I hope this helps. Do let us know how it goes. Thank you.

Viewing 1 replies (of 1 total)

The topic ‘Happy Forms API’ is closed to new replies.

 * ![](https://ps.w.org/happyforms/assets/icon-256x256.png?rev=2778164)
 * [Happyforms - Form Builder for WordPress: Drag & Drop Contact Forms, Surveys, Payments & Multipurpose Forms](https://wordpress.org/plugins/happyforms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/happyforms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/happyforms/)
 * [Active Topics](https://wordpress.org/support/plugin/happyforms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/happyforms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/happyforms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Harries Happyforms](https://wordpress.org/support/users/happyformsharries/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/happy-forms-api/#post-18023067)
 * Status: not resolved