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



Form Tools
Outputting info on thank you 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: Outputting info on thank you page (/showthread.php?tid=212)



Outputting info on thank you page - rubycat - Jul 12th, 2009

I'm sure I must be missing it in the documentation but how exactly does one output the information provided by the person who is filling out the form on the "thank you" page when using the API?


RE: Outputting info on thank you page - Ben - Jul 12th, 2009

Heya,

Sure, this is no problem! On the final page, you should have something like this at the top of your page:

PHP Code:
<?php
require_once("path/to/global/api/api.php");
$fields ft_api_init_form_page();
ft_api_clear_form_sessions();
?>

To access any of the form field values, you can extract them from the $fields variable. For example, if your form contained "first_name" and "email" fields, you could just add this PHP to your page:

Code:
First Name: <?=$fields["first_name"]?><br />
Email: <?=$fields["email"]?><br />

Hope this helps -

Ben


RE: Outputting info on thank you page - rubycat - Jul 12th, 2009

Code:
First Name: <?=$fields["first_name"]?><br />
Email: <?=$fields["email"]?><br />

Okay, I was doing it with an "@" sign preceding the $fields but if I remove it, it fails completely. I'm doing it like this:

Code:
<?=@$fields["first_name"]?><br />
<?=@$fields["email"]?><br />

And how do I get the anwsers from a multi-select? If I do this:
Code:
<?=@$fields["categories[]"]?>
...nothing gets output

If I do it without the brackets, I get the word "Array" output and nothing else.

And, if a field is left blank during the data entry, is there a way to conditionally make it so that nothing gets output on the thank you page?


RE: Outputting info on thank you page - Ben - Jul 12th, 2009

Good questions!

(btw, the @ symbol just prevents any warnings from being outputted to the screen if the variable isn't defined).

Displaying the values in multi-select works like this. First, drop the [] characters. It's weird, I know, but they're only used when submitting the data via a form - it tells the server to expect an array of values. Try this instead:

PHP Code:
<?=join(", "$fields["categories"])?>

It displays the values in $categories, separates by ", ".

Quote:And, if a field is left blank during the data entry, is there a way to conditionally make it so that nothing gets output on the thank you page?

Sure, here's an example.

Code:
<?php if (!empty($fields["first_name"])) { ?>
  First Name: <?=$fields["first_name"]?>
<?php } ?>

All the best -

Ben


RE: Outputting info on thank you page - rubycat - Jul 13th, 2009

Thank you for this! Works great!