Sending data to another script using target=_blank

Home Forums Quform WordPress Sending data to another script using target=_blank

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

    Hi, I read all the samples and got the code in my functions.php and it looks good but I need to add the target = _blank on post. So after the people hit “submit”, the fields are parsed and the scrennopen on my post url.

    Please help, it will be much appreciated.

    This is the code I have:

    function mytheme_post_to_another_script($form)
    {
    // Rewrite the post variables
    $post = array(
    ‘numberOfRooms’ => $_POST[‘iphorm_1_1’],
    ‘numberOfAdults’ => $_POST[‘iphorm_1_4’],
    ‘numberOfChildren’ => $_POST[‘iphorm_1_5’],
    ‘checkinDateStr’ => $_POST[‘iphorm_1_2’],
    ‘checkoutDateStr’ => $_POST[‘iphorm_1_3’],
    );

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

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, ‘http://demo.webhotel.microsdc.us/bp/availStart.jsp’);
    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’, ‘mytheme_post_to_another_script’, 10, 1);

    #12031
    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 11 years, 1 month ago by Ally. Reason: Edited code to add access to $form object to get form values
    #12110
    mxwealth
    Participant

    Hello,

    I was able to achieve a submission into another database using your built in settings (i didn’t know you have the option to input another database and mapping the fields). This is great!!!!!!!!!!!!

    Just one thing,

    This works only if the website where the contact form is is in the same host as the database but, I have tried adding to another database in a different server and no luck.

    I added my server host, ips, etc and whitelisted them, added to remotemysql and additional mysql access hosts and nothing. Do you have any suggestions?

    #12124
    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. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy