Please help with custom action

Home Forums Quform WordPress Please help with custom action

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3193
    terrykent
    Participant

    I am trying to get a Quform form to deliver to a custom action. I have followed the guide that was suggested by the TC team but I just cannot get it to work. This is my functions.php file contents:-

    <?php

    /* Insert your custom functions here */

    function mytheme_post_to_another_script($form)
    {
    // Create a new cURL resource
    $ch = curl_init();

    // Rewrite the post variables
    $post = array(
    'stkref' => $_POST['iphorm_2_1'],
    'stkdesc' => $_POST['iphorm_2_2'],
    'dispstk' => $_POST['iphorm_2_4'], // Change iphorm_X_X to name field unique ID 'email' => $_POST['iphorm_X_X'], // Change iphorm_X_X to email field unique ID 'phone' => $_POST['iphorm_X_X'], // Change iphorm_X_X to phone field unique ID 'message' => $_POST['iphorm_X_X'] // Change iphorm_X_X to message field unique ID );

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, 'http://stockchecker.brausch.co.uk/stockchecker/stockreport.php');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));

    // Send the request
    curl_exec($ch);

    // Close cURL resource, and free up system resources
    curl_close($ch);
    }
    add_action('iphorm_post_process_2', 'mytheme_post_to_another_script', 10, 1);
    ?>

    Please can someone tell me where I am going wrong.

    Thank you in advance.
    Terry

    #3205
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy