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
Failure to redirect to thank you page upon submission
#11
On the thank you page you can just add the parameter "no_sessions_url" => "index.php" to redirect users who try to access the page directly.

Cheers,

Joe
Reply
#12
Hi Joe,

Thanks, that would be great! wasn't that i'm not familiar enough with php to understand how to implement it, So if you could help me out a bit more i would be utterly thankful ;-)
I guess index.php could also be the url of the form page for registering?
Where should i put the code?

The code at the top of my thank you page was:

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

I added it into:

<?php
require_once("../formtools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array("no_sessions_url" => "/formulier-infomap.php");ft_api_clear_form_sessions();
?>

But that doesn't do the trick, i'm not redirected to the form page....
any ideas?
Thanks again for your time,
Peter
Reply
#13
Hey Peter,

The code should always be at the top of the page. The code actually looks right but you should be using the path to the API: require_once("/home/scottfam/public_html/babybraceletsandsuch.com/form_tools/global/api/api.php");

Try that and see if it works.

Cheers,

Joe
Reply
#14
Hi Joe,

If i point to the api.php like you sugested:
require_once("/var/www/vhosts/marcheservices.eu/httpdocs/formtools/global/api/api.php");
the thank you page does not redirect either...

the top of the thank you page looks like this now:
<?php
require_once("/var/www/vhosts/marcheservices.eu/httpdocs/formtools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array("no_sessions_url" => "/infomap/formulier-infomap.php");
ft_api_clear_form_sessions();
?>

In my case the formulier-infomap.php is the registration form wich is together with the thank you page situated in the directory infomap. infomap and formtools directory are both in the root of my site

Realy would like this to work because it would be a simple solution that solves my problem......

Thanks for your time!
Reply
#15
Hey Peter,

I should have noticed this earlier. You're actually missing the function to process the parameters. Your code should look like this:

<?php
require_once("/var/www/vhosts/marcheservices.eu/httpdocs/formtools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array("no_sessions_url" => "/infomap/formulier-infomap.php");
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>

Hope this helps.

Cheers,

Joe
Reply
#16
Hi Joe....

Sorry, but that doesn't work. Don't know why but if i change it to what you suggested i get the following error: (either by going directly to the thank you page but also when i get there after filling out the registration form...)

ERROR
Error Type: User
Error Code: #306 — Learn more about this error.

Thank you for your help so far....
Peter
Reply
#17
Hi Peter,

Try this instead:

<?php
require_once("/var/www/vhosts/marcheservices.eu/httpdocs/formtools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array(
"no_sessions_url" => "/infomap/formulier-infomap.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>

Cheers,

Joe
Reply
#18
(Apr 29th, 2014, 11:20 AM)Joe Wrote: Hi Peter,

Try this instead:

<?php
require_once("/var/www/vhosts/marcheservices.eu/httpdocs/formtools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array(
"no_sessions_url" => "/infomap/formulier-infomap.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>

Cheers,

Joe

Hi Joe!
that did the trick! Thanks man, i'm really thankful for your help!
Keep up the good work!

Peter
Reply
#19
Hey Peter,

Glad everything is working! All the best!

Cheers,

Joe
Reply
#20
I'm having the same issue with a single-page form.

Everything works beautifully except for the redirect to the "thank you" page after submitting. After submitting, a blank form page is displayed, rather than the redirect page.

Form Tools version 2.0.6

Form Page PHP (index.php):

<?php
require_once(“/path/to/formtools/global/api/api.php");
$fields = ft_api_init_form_page(12);
$params = array(
"submit_button" => "submitform",
"next_page" => "thankyou.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
?>

Form Tag:

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">

Named submit button:

<input name="submitform" type="submit" value="Submit" />

Thank You Page PHP (thankyou.php — in the same directory as index.php):

<?php
require_once(“/path/to/formtools/global/api/api.php");
$fields = ft_api_init_form_page();
ft_api_clear_form_sessions();
?>

I should note that I've modified this form to use the Form Tools API, and as such the Redirect URL isn't configured for this form in the admin interface. I followed this tutorial: http://docs.formtools.org/tutorials/api_...page=step1

When it was using the direct form submission method, the redirect worked as expected.

Am I missing something obvious? Do I need to upgrade Form Tools to the latest version?

Any help is appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)