The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Can't get the data on receipt page - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: Can't get the data on receipt page (/showthread.php?tid=1476)



Can't get the data on receipt page - cytegi - Jul 23rd, 2011

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_forms_redirect_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


RE: Can't get the data on receipt page - Ben - Jul 23rd, 2011

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


RE: Can't get the data on receipt page - cytegi - Jul 23rd, 2011

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




RE: Can't get the data on receipt page - Ben - Jul 23rd, 2011

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




RE: Can't get the data on receipt page - cytegi - Jul 24th, 2011

Hey Ben,

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

Best.
AP


RE: Can't get the data on receipt page - Ben - Jul 28th, 2011

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

- Ben


RE: Can't get the data on receipt page - lobaluna - May 22nd, 2016

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