• 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 to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Harries Happyforms

    (@happyformsharries)

    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:

    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)
  • You must be logged in to reply to this topic.