Sending Form Data to Script

Home Forums Quform WordPress Sending Form Data to Script

This topic is: resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3190
    lawrencepepper
    Participant

    I am sending my form data to a script. I have done this on another site and it works flawlessly. On a different site I am developing I am trying to do the same thing but the code is not sending any data.

    Can not figure out for the life of me why…


    function draw_post_to_another_script($form)
    {
    // Rewrite the post variables
    $post = array(
    'prefix' => $_POST['iphorm_1_3'],
    'description' => $_POST['iphorm_1_4'],
    'type' => $_POST['iphorm_1_7'],
    'notes' => $_POST['iphorm_1_10'],
    'edate' => $_POST['iphorm_1_11'],
    'user' => $_POST['iphorm_1_12'],

    );

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

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, 'my url');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));

    // Grab URL and pass it to the browser
    curl_exec($ch);

    // Close cURL resource, and free up system resources
    curl_close($ch);
    }
    add_action('iphorm_post_process_1', 'draw_post_to_another_script', 10, 1);

    On the script page I am trying to list out the post data being sent and nothing lists.

    Code used on script page:

    echo "Description:".$_POST[description]."<br>";
    echo "Prefix:".$_POST[prefix]."<br>";
    echo "Notes:".$_POST[notes]."<br>";

    This is what displays:

    Description:
    Prefix:
    Notes:

    The post data is blank.

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

    #3330
    lawrencepepper
    Participant

    Sorry for the late response, was out for the past week.

    Tried this but nothing shows, no errors.

    L

    #3331
    lawrencepepper
    Participant

    Getting this error in lof file:


    [11-Mar-2013 14:31:16] PHP Notice: get_theme_data is <strong>deprecated</strong> since version 3.4! Use wp_get_theme() instead. in C:\Users\Administrator\Documents\Websites\edata\wp-includes\functions.php on line 2839

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

    #3341
    lawrencepepper
    Participant

    I am trying to take the data and do an update to a mysql database.

    Even when I do a variable dump on the page it lists nothing in the array.

    The database update does not do anything as there is no data.

    I have also tried a work around by setting the data as session variables:


    function record_update($form)
    {
    $_SESSION['iphorm_4'] = $form-&gt;getValues();
    }

    add_action('iphorm_post_process_4', 'record_update');

    This also does not work the variables do not get set.

    Yet in the same functions.php page I have:

    function record_lookup($form)
    {
    $_SESSION['iphorm_5'] = $form->getValues();
    }

    add_action('iphorm_post_process_5', 'record_lookup');

    And this works fine.

    I am at a loss?

    L

    #3342
    lawrencepepper
    Participant

    OK,

    Must have been a typo or a gremlin.

    I deleted all the code and the script started from scratch and now it works.

    oh well….

    Thanks!

    L

    #3344
    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 8 posts - 1 through 8 (of 8 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