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
Passing On info to the success page
#11
Hey wsargent,

Oops, no I was mistaken. My original post was okay - the value SHOULD be there. haha Smile

So you're only getting those two values? Doesn't your form contain any other fields, or did you just omit those when pasting it in the post?

I've actually been reading over my code for almost an hour now and it all seems pretty sound. I don't suppose it would be possible to get access to your site so I could debug the problem directly? If so, email me your Form Tools login, form name & FTP info at ben.keen@gmail.com.

- Ben
Reply
#12
I can give you the login info etc, but unfortunately my institution won't let you login to FTP remotely Sad
Reply
#13
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:

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
Reply
#14
Ben, I sent you an email on this but thought I'd try to get a hold of you this way as well. I'm having one heck of a time getting this to to work. Can you please take a look at my code and let me know if you see anything wrong?

Form is located at:http://www.roadcareplus.com/main/activation-online.php
Thank you:http://www.roadcareplus.com/main/thankyou-online.php


FORM PAGE PHP:

<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page("4");

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

$params = array(
"submit_button" => "submit",
"next_page" => "thankyou-online.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
?>

//Just showing you the action part of my form

<form id="form" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST" onsubmit="return rsv.validate(this, rules)">



THANK YOU PAGE PHP:

//Prior to the HTML tag

<?php
require_once("formtools/global/api/api.php");

$fields = ft_api_init_form_page();

ft_api_clear_form_sessions();

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

?>

//In the div where I want my results

<?php
if (!empty($submission_id) && !empty($unique_key))
{
$form_id = 4;
$view_id = 4;
$export_type_id = 3;

{
ft_api_show_submission($form_id, $view_id, $export_type_id, $submission_id);
}
}
?>

Note: All of the tutorials stated that I should have seen a value in my url string when I checked the "pass on" radio button. I was never able to get that to work prior to trying your method in this thread. Perhaps my values aren't being passed at all? I don't know how to properly debug.

Thanks so much for any help you can give.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)