Home › Forums › Quform PHP › sending data to a script
- This topic has 3 replies, 2 voices, and was last updated 9 years, 10 months ago by Ally.
- AuthorPosts
- January 19, 2015 at 11:59 pm #13674oliverletzParticipant
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,
OliverBtw, I really love Quform!
January 22, 2015 at 3:44 pm #13693AllySupport 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 9 years, 10 months ago by Ally. Reason: Typo
January 22, 2015 at 4:40 pm #13702oliverletzParticipantHi 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,
OliverJanuary 22, 2015 at 4:56 pm #13705AllySupport 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.