Apr 22nd, 2014, 10:39 AM
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
Cheers,
Joe
The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Failure to redirect to thank you page upon submission
|
Apr 22nd, 2014, 10:39 AM
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
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
Apr 25th, 2014, 9:32 PM
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
Apr 26th, 2014, 12:07 AM
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!
Apr 28th, 2014, 9:45 AM
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
Apr 28th, 2014, 12:51 PM
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
Apr 29th, 2014, 11:20 AM
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
Apr 29th, 2014, 1:55 PM
(Apr 29th, 2014, 11:20 AM)Joe Wrote: Hi Peter, Hi Joe! that did the trick! Thanks man, i'm really thankful for your help! Keep up the good work! Peter
Apr 30th, 2014, 6:32 PM
Hey Peter,
Glad everything is working! All the best! Cheers, Joe
May 14th, 2014, 10:24 AM
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. |
« Next Oldest | Next Newest »
|