sending data to a script

Home Forums Quform PHP sending data to a script

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13674
    oliverletz
    Participant

    Hello,
    I am trying to send data from my form to a script (ip address). I tried the instructions from the WordPress Quform forum bur I am getting an error in the last line of the additional code:


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

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, 'http://xxx.xxx.xxx/');
    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('process', 'mytheme_post_to_another_script', 10, 1);

    I added this code into the process.php in the Custom code section #2. What am I doing wrong?

    Thank you for your help!
    Best,
    Oliver

    Btw, I really love Quform!

    #13693
    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.

    • This reply was modified 9 years, 10 months ago by Ally. Reason: Typo
    #13702
    oliverletz
    Participant

    Hi Ally,
    thank you so much for the quick response.

    I am still getting the following error:

    Fatal error: Call to undefined function curl_init() in /mnt/drbd1/www/isis/e15/js-plugin/quform/process-afp-viewer.php on line 447

    My custom code looks like this now:


    // Custom code section #2 - see documentation for examples

    // Create a new cURL resource
    $ch = curl_init();

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, 'http://xxx.xxx.xxx/');
    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);

    // End custom code section #2

    The cURL php module is installed.

    Thank you again for your help.
    Best,
    Oliver

    #13705
    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 4 posts - 1 through 4 (of 4 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