Getting just the data out…

Home Forums Quform WordPress Getting just the data out…

This topic is: not resolved
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #32221
    jwrbloom
    Participant

    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.)

    #32227
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #32228
    jwrbloom
    Participant

    I 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 2 weeks, 1 day ago by jwrbloom.
    #32232
    jwrbloom
    Participant

    Just 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 4

    Here 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 2 weeks, 1 day ago by jwrbloom.
    #32235
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #32242
    jwrbloom
    Participant

    That 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.

    • This reply was modified 2 weeks ago by jwrbloom.
    • This reply was modified 2 weeks ago by jwrbloom.
    • This reply was modified 2 weeks ago by jwrbloom.
    #32247
    jwrbloom
    Participant

    I’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.

    #32251
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #32252
    jwrbloom
    Participant

    Just 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

    #32253
    jwrbloom
    Participant

    Tried 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 1 week, 6 days ago by jwrbloom.
    #32257
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #32261
    jwrbloom
    Participant

    Still 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_csv

    #32266
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy