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
Thank you page issue (not passing on)
#1
Hello Ben,
Hey Thanks for this awesome program you have here . .
I am setting up a form and and having issues passing on form field to thank you page . .
I went through all the tutes and read some of the threads here but it seems that my answers are not here . . . here are my code tags
In form head:
Code:
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(3);
$params = array(
  "submit_button" => "mcs_order",
  "next_page" => "confirmation.php",
  "form_data" => $_POST,
  "finalize" => true
    );
ft_api_process_form($params);
?>

In form action:
Code:
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

This is in thank you head:
Code:
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page();
ft_api_clear_form_sessions();
$submission_id = $fields["formtools_submission_id"];
$unique_key    = $fields["unique_key"];


?>

This is in my Div tag"
Code:
<?php
if (isset($_GET["submission_id"]) && isset($_GET["unique_key"]))
{
  $form_id = 3;
  $view_id = 1;
  $export_type_id = 1;

  $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"]);
  }    
}
?>

I installed all the modules and checked all the pass on variables but I get no code in my address bar and the thank you page is blank . .
Here is the form links
http://www.militarycuts.com/form.php

Thanks in advance
ciao
Reply
#2
Hey gpdesigner,

Hmm! At a quick glance, your code looks okay. So when you say your thank you page is blank, do you mean totally while (no HTML at all), or just that the results aren't being output into the page?

If the latter, you could try adding this to the PHP at the top of the page (after the ft_api_init_form_page() function call):
Code:
print_r($fields);

That will output everything that it found in sessions at that point.

However, I looked at your form page and things look a little wonky. The form doesn't submit on Firefox. Since I don't see any offending JS, my hunch is that the markup is a little wrong.

One thing I noticed (and this may well be unrelated), but I don't think comments of this form are valid: <!----- ------> They should only be <!-- --> (only two dashes either side). When I view source in Firefox, it shows a great deal of your page to be commented out. Also, I ran into a problem one time with XHTML strict when my javascript had lines of ----- in it. That also threw errors in Safari or something... Generally best to stick to the standard comment tags to ensure all weird & wonderful browsers won't break.

Let me know how it goes.

- Ben
Reply
#3
Hello Ben Thanks for the speedy reply,
it is much appreciated.

(Jun 3rd, 2011, 1:27 AM)Ben Wrote: If the latter, you could try adding this to the PHP at the top of the page (after the ft_api_init_form_page() function call):
Code:
print_r($fields);

I put the code in and it did print out the session at the top of the page so I guess it is coming through, why it isn't showing up in the div is a mystery to me. Maybe I need to tinker with the way I put in the PHP ?

(Jun 3rd, 2011, 1:27 AM)Ben Wrote: However, I looked at your form page and things look a little wonky. The form doesn't submit on Firefox.

What version of FF are you using, I am cross browser testing and I am seeing it on everything,

(Jun 3rd, 2011, 1:27 AM)Ben Wrote: One thing I noticed (and this may well be unrelated), but I don't think comments of this form are valid: <!----- ------> They should only be <!-- --> (only two dashes either side). When I view source in Firefox, it shows a great deal of your page to be commented out. Also, I ran into a problem one time with XHTML strict when my javascript had lines of ----- in it. That also threw errors in Safari or something... Generally best to stick to the standard comment tags to ensure all weird & wonderful browsers won't break.


I will look into that maybe the extended comments are screwing things up in Safari on Mac, but it is working fine everywhere else . . . I will give it a look see . . . I have been commentint things out with multiple dashes since 2004 on all my websites, seems this practice is catching up with me, at least when I am using JS on the pages . .

Anyway as I said after adding the bit of code you gave me the session is printing out at the top of all browser pages, what is next?
gp
Reply
#4
Heya,

Ah! The problem is that you're detecting for values in the query string, not the fields returned from sessions. Try changing this line:

Code:
if (isset($_GET["submission_id"]) && isset($_GET["unique_key"]))

to this:

Code:
if (isset($fields["form_tools_submission_id"]) && isset($fields["unique_key"]))

That may help.

- Ben
Reply
#5
(Jun 3rd, 2011, 6:38 AM)Ben Wrote: Heya,

Ah! The problem is that you're detecting for values in the query string, not the fields returned from sessions. Try changing this line:

Code:
if (isset($_GET["submission_id"]) && isset($_GET["unique_key"]))

to this:

Code:
if (isset($fields["form_tools_submission_id"]) && isset($fields["unique_key"]))

That may help.

- Ben

Oppps I got an FormTools error page . . . code 406
let me check to see if i pasted wrong
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)