Home › Forums › Quform WordPress › Getting just the data out…
- This topic has 12 replies, 2 voices, and was last updated 4 years ago by Ally.
- AuthorPosts
- November 16, 2020 at 12:40 pm #32221jwrbloomParticipant
I checked out the hooks, but I didn’t see anything that applied. (Maybe that’s my answer.)
I’d like to have a form produce multiple rows of data.
First Name, Last Name, School, etc
There will probably anywhere from 10-15 rows entered by the user.
In the notification that is produced, can I just have it produce just the answers and not the field labels? Ultimately, I’d like to send the submission to a .php file that inserts the rows into a database. (I can do that part…I think.)
November 17, 2020 at 10:09 am #32227AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 17, 2020 at 12:21 pm #32228jwrbloomParticipantI saw the groups workaround, and that’s essentially what I’m doing. Great point about using the variables in the email. I can create my own CSV in the email.
Is this another option?
If I send that string of data (realizing they aren’t actually repeatable fields) to a .php, I could effectively add hidden elements to create field and line terminations. Does that sound about right?I guess my question is, can I just get some variation of a var_dump?
- This reply was modified 4 years ago by jwrbloom.
November 17, 2020 at 2:03 pm #32232jwrbloomParticipantJust sending the form to a .php to try this out:
$value = $form->getValue(‘quform_10_60’);I keep getting this error:
Fatal error: Uncaught Error: Call to a member function getValue() on null in /home2/csi/public_html/wp-content/plugins/csi_stats/csi_roster_process.php:4 Stack trace: #0 {main} thrown in /home2/csi/public_html/wp-content/plugins/csi_stats/csi_roster_process.php on line 4Here is my code:
$value = $form->getValue('quform_10_60'); echo $value; echo 'Hello'; $post_data = file_get_contents('php://input'); echo "<div> POST BODY <br>".$post_data."</div>";
- This reply was modified 4 years ago by jwrbloom.
November 18, 2020 at 10:00 am #32235AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 18, 2020 at 1:26 pm #32242jwrbloomParticipantThat was the full code.
Then I marked that out and put this:
add_action('quform_get_value_for_storage_10', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3);
Same error.
November 18, 2020 at 5:21 pm #32247jwrbloomParticipantI’ve tried getValues() as well.
Same error.
However, do I need to code in the array too? I’m just looking for a way to have all the data dumped.
November 19, 2020 at 11:29 am #32251AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 19, 2020 at 12:13 pm #32252jwrbloomParticipantJust answering the question you asked, then I’ll try out the code you posted.
I’m sending the form to the PHP via the form’s settings.
Settings > Confirmation > Default Confirmation > Display message then redirect to custom URL
November 19, 2020 at 2:20 pm #32253jwrbloomParticipantTried both codes blocks separately, and they each produced this error:
Fatal error: Uncaught Error: Call to undefined function add_filter() in /home2/csi/public_html/wp-content/plugins/csi_stats/csi_roster_process.php:3 Stack trace: #0 {main} thrown in /home2/csi/public_html/wp-content/plugins/csi_stats/csi_roster_process.php on line 3
What I want is to submit the form, have it redirect to a .php and dump the data so I can treat it like a CSV.
- This reply was modified 4 years ago by jwrbloom.
November 20, 2020 at 11:09 am #32257AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 20, 2020 at 6:31 pm #32261jwrbloomParticipantStill getting…
Fatal error: Uncaught Error: Call to undefined function add_filter() in /home2/csi/public_html/wp-content/plugins/csi_stats/csi_roster_process.php:4 Stack trace: #0 {main} thrown in /home2/csi/public_html/wp-content/plugins/csi_stats/csi_roster_process.php on line 15
/** * Plugin Name: CSI Stats * Plugin URI: https://courtsideindiana.com * Description: Stat Module * Version: 1.0 */ //include("/home2/csi/public_html/resources/con.php"); add_filter('quform_post_process_10', function (array $result, Quform_Form $form) { $session = quform('session'); $session->set('form_10', $form); return $result; }, 10, 2); add_action('wp', function () { if(!isset($_GET['submitted_form_csv']) || !function_exists('quform')) { return; } $session = quform('session'); $form = $session->get('form_10'); if(!$form instanceof Quform_Form) { die('Form not found'); } var_dump($form->getValues()); exit; });
Here is the URL I’m redirecting to:
https://www.courtsideindiana.com/wp-content/plugins/csi_stats/csi_roster_process.php?submitted_form_csvNovember 24, 2020 at 10:29 am #32266AllySupport 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.