FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't get the data on receipt page
#1
Hi,

Using the API method - but I can't get the data to display on the receipt (thank you) page. I did everything that's on this tutorial http://docs.formtools.org/tutorials/post...rect_data/

Since the form has about 25 fields, its not possible to use the other method where you check all field values to "pass on" due to character limits on URLs.

Here is my code on the form page:
PHP Code:
<?php
require_once("appform/global/api/api.php");
$fields ft_api_init_form_page(1);
$submission_id $fields["submission_id"];
$unique_key $fields["unique_key"];
$params = array(
  
"submit_button" => "submit",
  
"next_page" => "apply1112confirm.php",
  
"form_data" => $_POST,
  
"finalize" => true
    
);
ft_api_process_form($params);
?>

Here is the code on receipt / thank you page:
before the head section->
PHP Code:
<?php
require_once("appform/global/api/api.php");
$fields ft_api_init_form_page();
ft_api_clear_form_sessions();
?>

...and in the body...
PHP Code:
<?php
if (isset($fields["submission_id"]) && isset($fields["unique_key"]))
{
  
$form_id 1;
  
$view_id 1;
  
$export_type_id 2
  
$submission_info ft_api_get_submission($form_id$_GET["submission_id"]);
 
  
// now confirm that the unique_key matches
  
if (isset($submission_info["unique_key"]) && $submission_info["unique_key"] == $_GET["unique_key"])
  {
    
ft_api_show_submission($form_id$view_id$export_type_id$_GET["submission_id"]);
  }    

What might I be missing?

Thanks
Reply
#2
Hi cytegi,

Ah... I think the problem due to the slightly different way in which the API stores the submission info and how the submission info is passed via the query string for POST forms. That tutorial is for post forms, so even though most of it holds true for the API, you need to make a small tweak.

One thing that sticks out is this line:

PHP Code:
if (isset($fields["submission_id"]) && isset($fields["unique_key"])) 

I think you'll need to change that to:

PHP Code:
if (isset($fields["form_tools_submission_id"]) && isset($fields["unique_key"])) 

The API adds a "form_tools_" prefix to the submission ID & form ID, since they're auto-generated and we don't want them conflicting with other form fields names.

You may need to do other tweaks too, but I'd start there. Also, if you run into more trouble, do a print_r($fields); on the receipt page to find out exactly what key-value pairs you have at your disposal.

Good luck! Smile

- Ben
Reply
#3
Ben,
Thanks for helping me out and for formtools! I am still having issues - when I did the print_r, I still got nothing. I then replaced the submission_id with form_tools_submission_id and I get a 406 error, which means that the submission ID parameter is invalid. Please help! I can give you to logins if you would like to see it...

(Jul 23rd, 2011, 2:53 PM)Ben Wrote: One thing that sticks out is this line:

PHP Code:
if (isset($fields["submission_id"]) && isset($fields["unique_key"])) 

I think you'll need to change that to:

PHP Code:
if (isset($fields["form_tools_submission_id"]) && isset($fields["unique_key"])) 

You may need to do other tweaks too, but I'd start there. Also, if you run into more trouble, do a print_r($fields); on the receipt page to find out exactly what key-value pairs you have at your disposal.

- Ben

Reply
#4
Heya,

Sure! Just email me your FTP info and the URL of your form (and path, if it's not obvious when I connect via FTP) and I'll take a quick look at it. Smile

- Ben

Reply
#5
Hey Ben,

Thanks for helping me out. I sent you an email with login info...

Best.
AP
Reply
#6
Thanks Amod. I know we just spoke over email, but I'll be getting to this today. Smile

- Ben
Reply
#7
Please, Ben, reply this thread with the results you have for cytegi. I would love to see them because this issue affects me either.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)