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
Problems showing form values on thanks page - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Problems showing form values on thanks page (/showthread.php?tid=765)



Problems showing form values on thanks page - shala - Jun 28th, 2010

First of all, thanks Ben for this excellent tool. Smile

Everything is going great, except for one last detail: we'd like the "thank you" page to display the form values so the user can print them. However, I can't get the values to show up. I've followed the tutorial and looked into past threads about the issue, but I still only get a blank space on my thank you page where the php coding is. It doesn't show any errors and the form otherwise submits as it should. I've noticed that up in the URL, a submission id is displayed but not a unique key (it's just blank after &unique_key=)

I'm new to Form Tools and PHP so I'm probably just missing something obvious somewhere! I appreciate any help, thanks.

At the top of the form page:
PHP Code:
<?php
require_once("/data/18/1/10/67/1662067/user/1792427/htdocs/ourforms/global/api/api.php");
 
$fields ft_api_init_form_page(1);

$submission_id $fields["form_tools_submission_id"];
$unique_key $fields["unique_key"];

$params = array(
  
"submit_button" => "Submit",
  
"next_page" => "templates/giftcertificatesuccess.php?submission_id=$submission_id&unique_key=$unique_key",
  
"form_data" => $_POST,
  
"finalize" => true
    
);
ft_api_process_form($params);
?>

At the top of the thanks page:
PHP Code:
<?php
require_once("/data/18/1/10/67/1662067/user/1792427/htdocs/ourforms/global/api/api.php");
$fields ft_api_init_form_page();
ft_api_clear_form_sessions();
?>

In the thanks page:
PHP Code:
<?php
if (isset($_GET["submission_id"]) && isset($_GET["unique_key"]))
{
  
$form_id 1;
  
$view_id 1;
  
$export_type_id 3;
 
  
$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"]);
  }    
}
?>



RE: Problems showing form values on thanks page - JanEllen - Jan 26th, 2011

This is the exact same scenario that I am trying to accomplish as well. I would like for our Thank You page to display the contents of the form all filled out so that the user can print it out, because there is a signature line at the bottom where they need to sign and date and mail back to us.

Any clues on how to go about this. I know only a tiny bit of PHP (I am basically a graphic designer - trying to be a programmer...lol...) but am willing to learn what I need to pull this off... If anyone out there can help, I would be OH so appreciative!

Our form is quite lengthy (I didn't put it into multiple pages because that just seemed too complicated for me...lol) but I REALLY need to "re-display" the completed form in its entirety so the user may print it out. OR, alternatively, maybe export to a PDF? (if there's a way to do that? if not, no biggie...)

Thanks in advance!


RE: Problems showing form values on thanks page - TechOnPurpose - Jan 28th, 2011

Hi,
I'm new to Form Tools, but I think I can answer this question.

The problem is that you are following the suggested placement of the session and field reset code.

At the top of the thank you page, only put the code:
PHP Code:
<?php
require_once("/data/18/1/10/67/1662067/user/1792427/htdocs/ourforms/global/api/api.php");
$fields ft_api_init_form_page();
// according to the api docs, this may have to be $fields = ft_api_init_form_page(X); where X is the form ID. See the documentation page on the function ft_api_clear_form_sessions().
?>

Then at the very bottom of your thank you page, put:
PHP Code:
<?php
ft_api_clear_form_sessions
();
?>

What is happening is that you are clearing the session info and post fields before you display them.

I hope this works for you. I haven't tried it, but it seems to be the logical reason for your failure to be able to print the data.





RE: Problems showing form values on thanks page - JanEllen - Jan 28th, 2011

Thanks, I ended up just ditching the API method and using the Direct one. I was able to make it work.

I am not sure that would have worked, maybe? It never was even getting to the Thank You page... it stayed on the application form page and just showed a blank white page.

Anyway, I decided that we could get away with using the Direct method for now, in the interest of getting this thing working. ;-)
Oh, and I also decided to have it just email the user instead of them printing the screen results since I could not figure that part out. ;-)


RE: Problems showing form values on thanks page - robert - Feb 2nd, 2011

Hi,

I'm new to this forum but think I can help with a solution.

First of all create a Connections folder with following php file (dbf.php) in it

PHP Code:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_dbf "localhost";
$database_dbf "your_database_name";
$username_dbf "the_database_user_name";
$password_dbf "the_database_user_password";
$dbf mysql_pconnect($hostname_dbf$username_dbf$password_dbf) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

Let your 'thanks' page start with following PHP code
(replace 'dbf' on filename and code with any name of your choice)

PHP Code:
<?php require_once('Connections/dbf.php'); ?>
<?php 
session_start
();

   
mysql_select_db($database_dbf$dbf);
    
   
$query_rsAnyName "SELECT * FROM ft_form_1 ORDER BY submission_id DESC";
                      
   
$rsAnyName mysql_query($query_rsAnyName$dbf) or die(mysql_error());
   
$row_rsAnyName mysql_fetch_assoc($rsAnyName);
   
$totalRows_rsAnyName mysql_num_rows($rsAnyName);

   
$cfieldname1  $row_rsAnyName['col_1'];   
   
$cfieldname2  $row_rsAnyName['col_2']; 

?>

The $cfieldname variables are those you wish to show wherever on your thanks page. For example if you wish to show a submitted Name and E-mail address:

PHP Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <
tr>
                    <
td width="22%">Name</td>
                    <
td width="78%"><?php print $cfieldname1?></td>
                  </tr>
                  <tr>
                    <td>E-mail</td>
                    <td><?php print $cfieldname2?></td>
                  </tr>

</table> 

Hope this helps. It works fine on my thanks pages.

Cheers,
Robert


RE: Problems showing form values on thanks page - Hannes - Feb 5th, 2011

Hi Robert,

one solution can also be to use http_get_vars...
on the last page of the form you modify the parameter "next_page"...
PHP Code:
"next_page" => "submit.php?variable=".$fields['myfield'], 
and on the submit page you use...
PHP Code:
<?php
echo $HTTP_GET_VARS["variable"];
?>

Cheers,
Hannes


RE: Problems showing form values on thanks page - JMW - Apr 13th, 2011

Hi, I'm relatively new to form tools.
But I have been using the "registration" demo form as a guide in creating my own form. The third page of the demo is a review page that displays all the form content entered and provides the option to print it out. Could that be the answer your looking for?