Oct 5th, 2010, 7:40 PM
I know we solved this by email, but just to close this thread:
Here's the problem: the code I posted only works for multi-page forms. What's happening is that the Submission Pre-Parser adds the unique_key to the POST request within the ft_api_process_form function, and at that point you've already passed the redirect URL as a parameter. Thing is, it's not defined, unlike the submission ID which is loaded as soon as you go to the page.
But it's actually an easy fix! Try this:
1. in your form file, change the "next_page" line to remove passing along the submission ID & unique key via the query string.
2. in your thankyou page, change the top PHP code to this:
On this page, the $fields variable does contain everything we need: so we don't need to pass anything via the query string at all!
Then, in the code later in the page, just reference those variables instead of the $_GET ones:
- Ben
Here's the problem: the code I posted only works for multi-page forms. What's happening is that the Submission Pre-Parser adds the unique_key to the POST request within the ft_api_process_form function, and at that point you've already passed the redirect URL as a parameter. Thing is, it's not defined, unlike the submission ID which is loaded as soon as you go to the page.
But it's actually an easy fix! Try this:
1. in your form file, change the "next_page" line to remove passing along the submission ID & unique key via the query string.
2. in your thankyou page, change the top PHP code to this:
PHP Code:
<?php
require_once("./global/api/api.php");
$fields = ft_api_init_form_page();
ft_api_clear_form_sessions();
$submission_id = $fields["form_tools_submission_id"];
$unique_key = $fields["unique_key"];
?>
On this page, the $fields variable does contain everything we need: so we don't need to pass anything via the query string at all!
Then, in the code later in the page, just reference those variables instead of the $_GET ones:
PHP Code:
<?php
if (!empty($submission_id) && !empty($unique_key))
{
// these variables will need to be defined with the appropriate value
ft_api_show_submission($form_id, $view_id, $export_type_id, $submission_id);
}
?>
- Ben