Home › Forums › Quform WordPress › Sending data to another script using target=_blank
- This topic has 3 replies, 2 voices, and was last updated 11 years ago by
Ally.
- AuthorPosts
- July 30, 2014 at 9:49 pm #12017
mxwealth
ParticipantHi, 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);August 1, 2014 at 5:18 pm #12031Ally
Support StaffYou 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
August 7, 2014 at 6:25 pm #12110mxwealth
ParticipantHello,
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?
August 9, 2014 at 4:07 pm #12124Ally
Support StaffYou 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
- AuthorPosts
- You must be logged in to reply to this topic.