Home › Forums › Quform WordPress › Sending Form Data to Script
- This topic has 7 replies, 2 voices, and was last updated 11 years, 8 months ago by Ally.
- AuthorPosts
- March 1, 2013 at 7:41 pm #3190lawrencepepperParticipant
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.
March 3, 2013 at 10:14 am #3206AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 11, 2013 at 2:18 pm #3330lawrencepepperParticipantSorry for the late response, was out for the past week.
Tried this but nothing shows, no errors.
L
March 11, 2013 at 2:32 pm #3331lawrencepepperParticipantGetting 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
March 12, 2013 at 11:15 am #3338AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 12, 2013 at 11:53 am #3341lawrencepepperParticipantI 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->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
March 12, 2013 at 12:21 pm #3342lawrencepepperParticipantOK,
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
March 12, 2013 at 12:31 pm #3344AllySupport 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.