Oct 28th, 2014, 3:22 PM
I was also having the same problem on a previously working form. It would not direct to the thank you page after submission. After reading many post and spending many hours I fixed my very simple error. Here was my original code:
<html>
<head>
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(3);
$order = ft_api_show_submission_count(3);
$params = array(
"submit_button" => "submit",
"next_page" => "thankYou.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>
<script type="text/javascript" src="js/formcCaculations.js"></script>
<script type="text/javascript" src="js/companyInfo.js"></script>
etc...
After I read the code should always be at the top of the page I change it to:
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(3);
$order = ft_api_show_submission_count(3);
$params = array(
"submit_button" => "submit",
"next_page" => "thankYou.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>
<html>
<head>
<script type="text/javascript" src="js/formcCaculations.js"></script>
<script type="text/javascript" src="js/companyInfo.js"></script>
etc...
Simply moving the <html><head> tags below the php code fixed the problem for me. Hopefully it could be just as simply for some of you having the same problem. I guess I must have moved those tags during one of my edits (although I don't know why) as this was a working form.
One curious item: When testing this site on my local xampp server it didn't matter where the <head><head> tags were, it worked both ways. Only on the online live site does the order matter. Hope this helps..
<html>
<head>
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(3);
$order = ft_api_show_submission_count(3);
$params = array(
"submit_button" => "submit",
"next_page" => "thankYou.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>
<script type="text/javascript" src="js/formcCaculations.js"></script>
<script type="text/javascript" src="js/companyInfo.js"></script>
etc...
After I read the code should always be at the top of the page I change it to:
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(3);
$order = ft_api_show_submission_count(3);
$params = array(
"submit_button" => "submit",
"next_page" => "thankYou.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
ft_api_clear_form_sessions();
?>
<html>
<head>
<script type="text/javascript" src="js/formcCaculations.js"></script>
<script type="text/javascript" src="js/companyInfo.js"></script>
etc...
Simply moving the <html><head> tags below the php code fixed the problem for me. Hopefully it could be just as simply for some of you having the same problem. I guess I must have moved those tags during one of my edits (although I don't know why) as this was a working form.
One curious item: When testing this site on my local xampp server it didn't matter where the <head><head> tags were, it worked both ways. Only on the online live site does the order matter. Hope this helps..