Support » Plugin: Ninja Forms Contact Form - The Drag and Drop Form Builder for WordPress » How to process submitted data in v.3?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Kyle B. Johnson

    (@kbjohnson90)

    Hey @dino127,

    Here is the link that I sent you via the developer forms, for archival purposes: http://developer.ninjaforms.com/codex/submission-processing-hooks/

    dino127

    (@dino127)

    Hey, Kyle!
    Thanks for the respond, but it is clear, that clear nothing for now…
    Look:
    1/ if I add to functions

    add_filter( ‘ninja_forms_submit_data’, ‘my_ninja_forms_submit_data’ );

    function my_ninja_forms_submit_data( $form_data ) {
    return print_r($form_data); // just to look what is there
    }
    – nothing happen and the form is stopped with button “processing…” something wrong… and It seems to me – that the form hangs correctly : I try to use add_filter before hook apply…
    ok:
    2/ declare new shortcode in functions:

    function my_ninja_forms_submit_data( $form_data ) {
    return print_r($form_data); // just to look what is there
    }

    function ninja_process(){
    add_filter( ‘ninja_forms_submit_data’, ‘my_ninja_forms_submit_data’ );
    }

    add_shortcode( ‘test’, ‘ninja_process’ );

    I redirected ninja form to the page with [test] : everything is going on (now add_filter after apply_filter hook), but the redirected page is empty… There is no print_r($form_data)… Ok, I tried to return this way:
    function my_ninja_forms_submit_data( $form_data ) {
    print_r($form_data);
    return $form_data[ ‘fields’ ][0];
    }
    – nothing… Page is empty… How in the end THIS SHOULD WORK?.. the simplest situation, but nothing… and there are a lot of questions in web, but no answers…

    [ No bumping please. ]

    • This reply was modified 3 years ago by dino127.
    • This reply was modified 3 years ago by dino127.
    • This reply was modified 3 years ago by dino127.
    • This reply was modified 3 years ago by Jan Dembowski.
    dino127

    (@dino127)

    nothing understood… Who marks the questions as RESOLVED? Nothing resolved…
    Who wants me to bump the post? – I only corrected it to be more realized during 15 min. – is it a BUMP? What’s the matter with correct behavior?
    The questions as it was at once – how to proceed the sent data? The answer from the link – does not work. How to answer again?

    dino127

    (@dino127)

    really – I do not understand at all – the simplest question about the forms – which ninja and IS – how to handle the sent data – …. archive topics, something undeclared and unsubscribed… – that should be N1 everywhere/ Ok – I understood – u can say: it only for the money – and say this, for what aims marking resolved, bumping… WHERE ONE CAN READ about sent data handling in v.3? Difficult to write?

    Plugin Author Kyle B. Johnson

    (@kbjohnson90)

    The easiest way to get form data to another page is to use a redirect to a URL with query string values (using merge tags).

    ie http://site.com/another-page?name={field:name}

    This can be setup in the form builder’s Redirect Action. Then on the page that you redirect to, you can access the values from the $_GET global variable.

    ie $name = $_GET[ 'name' ];

    Also, you probably aren’t seeing anything from your dump because it is inside of an AJAX request, so executing PHP will not display directly in the browser.

    • This reply was modified 3 years ago by Kyle B. Johnson. Reason: added links to docs for redirect
    • This reply was modified 3 years ago by Kyle B. Johnson. Reason: added a link for post on merge tags
    dino127

    (@dino127)

    Yes, Kyle, this variant is working. Thank You!
    But… this approach is very… hm… unsecure, no any nonces and so on. Sure I can implement that with hidden fields. But – is it really without classes, checkers, inner implementation for POST and so on? May be – because of redirection?
    OK – what way I can handle the data at THE SAME PAGE, without redirection.
    Fine – if AJAX, – where I can read about the variables from ajax, how to handle them, because I am sure – there are not simple echo…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to process submitted data in v.3?’ is closed to new replies.