Jonathan Greenberg
asked on
How to work with Ninja Forms user submitted values in WP
In my client's WordPress site, I have a web page with a form that's set up to redirect to another page. I need to access the submitted form data from the redirect page, but the form values don't show up in a $_POST array on the redirect page.
Here's a Ninja Forms support page that I think provides instructions on how to achieve what I'm describing, but it's a bit over my head:
http://docs.ninjaforms.com/customer/portal/articles/1981023-processing-ninja_forms_processing
Do I need to add PHP to the form page? To the redirect page? Both?
I'd be grateful if someone who understands this page would have a look and tell me what I need to do to access the submitted form values from the redirect page.
Thanks!
Regards,
Jon
Here's a Ninja Forms support page that I think provides instructions on how to achieve what I'm describing, but it's a bit over my head:
http://docs.ninjaforms.com/customer/portal/articles/1981023-processing-ninja_forms_processing
Do I need to add PHP to the form page? To the redirect page? Both?
I'd be grateful if someone who understands this page would have a look and tell me what I need to do to access the submitted form values from the redirect page.
Thanks!
Regards,
Jon
ASKER
Yes, thank you, David, my site's Ninja Forms plugin is what I'm referring to.
The site has the Ninja Forms plugin installed. I need to know how to access the submitted form values from the page on the website that the user is redirected to after the form is submitted.
The site has the Ninja Forms plugin installed. I need to know how to access the submitted form values from the page on the website that the user is redirected to after the form is submitted.
ASKER
There were no useful answers.
ASKER
Here's the solution that I discovered. It simply requires knowing the form number and the number of the field whose value is sought:
<?php
global $ninja_forms_processing;
if ( 5 == $ninja_forms_processing->get_form_ID( 5 ) ) {
$user_value = $ninja_forms_processing->get_field_value( 18 );
echo $user_value;
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://en-ca.wordpress.org/plugins/ninja-forms/