Home › Forums › Quform WordPress › Please help with custom action
- This topic has 1 reply, 2 voices, and was last updated 11 years, 9 months ago by Ally.
- AuthorPosts
- March 2, 2013 at 9:28 am #3193terrykentParticipant
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.
TerryMarch 3, 2013 at 10:14 am #3205AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.