Jan 31st, 2010, 10:58 AM
Hey John,
Excellent! Sounds like you're making progress.
Actually, not quite: Form Tools has the option for direct forms to redirect with whatever submission info you want to be passed via the query string. To set this up, in the Form Tools admin section go to the Edit Form -> Fields tab. There, the penultimate column is labeled "pass on" and has a bunch of checkboxes. Just check the field for "Submission ID". Now, Form Tools will automatically append ?submission_id=X when redirecting to your thankyou page. So far so good.
Now we know we have the unique submission ID available in the query string, we can just pull it out with PHP. The first three parameters can just be hardcoded like you're doing now, but the submission ID needs to be dynamic. Try this code:
And be sure to include your API at the top of the page somewhere.
Basically, yes. This bit may be a bit hard to explain because it's SO versatile, but here's the gist of it: the content that's generated in your page is determined by two components:
(1) The View you've chosen (determined by the View ID you've passed the function)
(2) The Export Manager module's export type.
The View lets you choose which fields appear and the export type determines the actual markup for displaying the content. So for example, if you wanted Field 1, 2, 4 and 7 to show up on the page, you'd first create a new View for your form that shows that information. Then, you'd either pass the export ID of an existing Export Manager export type. "Export types" are just chunks of markup with placeholders in them that are used to generate the final markup (HTML, XML, CSV or whatever else).
Boy, this sounds confusing when I type it out, but it makes sense once you fiddle with it a bit. It's separated like this because it lets you present your form information in virtually any way you need - but this complexity does lead to confusion, I'll admit.
This sounds like a path problem. Check that the path you entered to the api.php file is correct. PHP require()'s function stops everything if it can't include the file specified.
Hope this info helps a bit...! Let me know if I wasn't clear on anything.
- Ben
Excellent! Sounds like you're making progress.
Quote:First I should change the link in the submit button from formtools/process.php to formtools/process.php?submission_id=X ?
Actually, not quite: Form Tools has the option for direct forms to redirect with whatever submission info you want to be passed via the query string. To set this up, in the Form Tools admin section go to the Edit Form -> Fields tab. There, the penultimate column is labeled "pass on" and has a bunch of checkboxes. Just check the field for "Submission ID". Now, Form Tools will automatically append ?submission_id=X when redirecting to your thankyou page. So far so good.
Quote:Second, I put <?php require("../formtools/global/code/api/api.php"); ft_api_show_submission(2, 2, 3, 14); ?> on the success page? As far as the #14 goes, is it left blank because each submission is a different ID? (not sure what to do here)
Now we know we have the unique submission ID available in the query string, we can just pull it out with PHP. The first three parameters can just be hardcoded like you're doing now, but the submission ID needs to be dynamic. Try this code:
PHP Code:
if (isset($_GET["submission_id"]) && is_numeric($_GET["submission_id"])) {
$submission_id = $_GET["submission_id"];
ft_api_show_submission(2, 2, 3, $submission_id);
}
And be sure to include your API at the top of the page somewhere.
Quote:Third any of the fields that I want to appear on the success page I should write '{$ANSWER_email} ' and they will appear?
Basically, yes. This bit may be a bit hard to explain because it's SO versatile, but here's the gist of it: the content that's generated in your page is determined by two components:
(1) The View you've chosen (determined by the View ID you've passed the function)
(2) The Export Manager module's export type.
The View lets you choose which fields appear and the export type determines the actual markup for displaying the content. So for example, if you wanted Field 1, 2, 4 and 7 to show up on the page, you'd first create a new View for your form that shows that information. Then, you'd either pass the export ID of an existing Export Manager export type. "Export types" are just chunks of markup with placeholders in them that are used to generate the final markup (HTML, XML, CSV or whatever else).
Boy, this sounds confusing when I type it out, but it makes sense once you fiddle with it a bit. It's separated like this because it lets you present your form information in virtually any way you need - but this complexity does lead to confusion, I'll admit.
Quote:Finally, when I put the <?php require("../formtools/global/code/api/api.php"); ft_api_show_submission(2, 2, 3, 14); ?> on my success page, the page is blank from where I entered it on the page. What am I doing wrong?
This sounds like a path problem. Check that the path you entered to the api.php file is correct. PHP require()'s function stops everything if it can't include the file specified.
Hope this info helps a bit...! Let me know if I wasn't clear on anything.
- Ben