<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Form Tools - API]]></title>
		<link>https://forums.formtools.org/</link>
		<description><![CDATA[Form Tools - https://forums.formtools.org]]></description>
		<pubDate>Tue, 14 Apr 2026 13:59:09 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[API and microsoft access]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=30388</link>
			<pubDate>Sun, 24 Dec 2017 14:19:45 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=30388</guid>
			<description><![CDATA[So we can use API with microsoft access?<br />
I need this for advanced stuffs :0]]></description>
			<content:encoded><![CDATA[So we can use API with microsoft access?<br />
I need this for advanced stuffs :0]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Error Code #304]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=30322</link>
			<pubDate>Thu, 14 Dec 2017 15:53:48 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=30322</guid>
			<description><![CDATA[Hey everyone,<br />
<br />
I am trying to create a php-based API form for use in FormTools. I am an novice to intermediate web designer. Sorry if my terminology is off. I keep getting error message #304. Does anyone have any advice? Copied text below.<br />
<br />
<span style="color: #2e6932;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: Verdana, sans-serif;" class="mycode_font"><span style="color: #cc0000;" class="mycode_color"><span style="font-size: x-small;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">ERROR</span></span></span></span></span></span><br />
<span style="font-size: x-small;" class="mycode_size"><span style="font-family: Verdana, sans-serif;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Error Type: <span style="color: #cc0000;" class="mycode_color">System</span> <br />
[b]Error Code: #304</span> — <a href="http://docs.formtools.org/api/index.php?page=error_codes#304" target="_blank" class="mycode_url"><span style="color: #008800;" class="mycode_color"><span style="font-family: Verdana, sans-serif;" class="mycode_font">Learn more about this error.</span></span></a>[/b]</span></span><br />
<span style="font-size: x-small;" class="mycode_size"><span style="font-family: Lato, sans-serif;" class="mycode_font">Debugging:</span></span><br />
<span style="font-size: x-small;" class="mycode_size"><span style="font-family: Verdana, sans-serif;" class="mycode_font">Failed query in <span style="font-weight: bold;" class="mycode_b">ft_api_process_form, /home/slcatl5/public_html/formtools/global/api/api.php</span>, line 811: <span style="font-style: italic;" class="mycode_i"><br />
UPDATE ft_form_35<br />
SET State = 'Virginia',<br />
policy_area = 'Agriculture and Natural Resources',<br />
program_name = 'Farmville',<br />
agency = 'Ag Department',<br />
contact_name = 'Bob',<br />
contact_title = 'Farmer',<br />
address_line_1 = '123',<br />
address_line_2 = '',<br />
city = '123',<br />
zip = '30033',<br />
phone = '123',<br />
email = 'bob@csg.org',<br />
website = '',<br />
descriptions = 'Files',<br />
heardaboutSTAR = 'Word of mouth',<br />
<br />
last_modified_date = '2017-12-14 18:43:44',<br />
ip_address = '173.165.175.169'<br />
<br />
WHERE submission_id = 4<br />
</span>Unknown column 'State' in 'field list'</span></span><br />
<br />
The form is here: <a href="https://www.slcatlanta.org/STAR/apply/" target="_blank" class="mycode_url">https://www.slcatlanta.org/STAR/apply/</a>. Thanks in advance for your help!]]></description>
			<content:encoded><![CDATA[Hey everyone,<br />
<br />
I am trying to create a php-based API form for use in FormTools. I am an novice to intermediate web designer. Sorry if my terminology is off. I keep getting error message #304. Does anyone have any advice? Copied text below.<br />
<br />
<span style="color: #2e6932;" class="mycode_color"><span style="font-size: large;" class="mycode_size"><span style="font-family: Verdana, sans-serif;" class="mycode_font"><span style="color: #cc0000;" class="mycode_color"><span style="font-size: x-small;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">ERROR</span></span></span></span></span></span><br />
<span style="font-size: x-small;" class="mycode_size"><span style="font-family: Verdana, sans-serif;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">Error Type: <span style="color: #cc0000;" class="mycode_color">System</span> <br />
[b]Error Code: #304</span> — <a href="http://docs.formtools.org/api/index.php?page=error_codes#304" target="_blank" class="mycode_url"><span style="color: #008800;" class="mycode_color"><span style="font-family: Verdana, sans-serif;" class="mycode_font">Learn more about this error.</span></span></a>[/b]</span></span><br />
<span style="font-size: x-small;" class="mycode_size"><span style="font-family: Lato, sans-serif;" class="mycode_font">Debugging:</span></span><br />
<span style="font-size: x-small;" class="mycode_size"><span style="font-family: Verdana, sans-serif;" class="mycode_font">Failed query in <span style="font-weight: bold;" class="mycode_b">ft_api_process_form, /home/slcatl5/public_html/formtools/global/api/api.php</span>, line 811: <span style="font-style: italic;" class="mycode_i"><br />
UPDATE ft_form_35<br />
SET State = 'Virginia',<br />
policy_area = 'Agriculture and Natural Resources',<br />
program_name = 'Farmville',<br />
agency = 'Ag Department',<br />
contact_name = 'Bob',<br />
contact_title = 'Farmer',<br />
address_line_1 = '123',<br />
address_line_2 = '',<br />
city = '123',<br />
zip = '30033',<br />
phone = '123',<br />
email = 'bob@csg.org',<br />
website = '',<br />
descriptions = 'Files',<br />
heardaboutSTAR = 'Word of mouth',<br />
<br />
last_modified_date = '2017-12-14 18:43:44',<br />
ip_address = '173.165.175.169'<br />
<br />
WHERE submission_id = 4<br />
</span>Unknown column 'State' in 'field list'</span></span><br />
<br />
The form is here: <a href="https://www.slcatlanta.org/STAR/apply/" target="_blank" class="mycode_url">https://www.slcatlanta.org/STAR/apply/</a>. Thanks in advance for your help!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Bug in ft_api_delete_unfinalized_submissions()]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=27709</link>
			<pubDate>Tue, 05 Sep 2017 08:05:41 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=27709</guid>
			<description><![CDATA[Hi,<br />
<br />
The ft_api_delete_unfinalized_submissions() uses curdate() instead of now() function to compare the submission time when the second parameter is false. The MySQL curdate() just returns a date e.g. D.M.YYYY without time information. However, the now() function returns the current date and time. So, the current implementation do not delete the unfinalized submissions older than 2 hours as stated in the documentation, but just those older than today. The correct way to comply with the documentation should be to use now() function.]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
The ft_api_delete_unfinalized_submissions() uses curdate() instead of now() function to compare the submission time when the second parameter is false. The MySQL curdate() just returns a date e.g. D.M.YYYY without time information. However, the now() function returns the current date and time. So, the current implementation do not delete the unfinalized submissions older than 2 hours as stated in the documentation, but just those older than today. The correct way to comply with the documentation should be to use now() function.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Non-consecutive IDs]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=27703</link>
			<pubDate>Tue, 05 Sep 2017 04:21:17 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=27703</guid>
			<description><![CDATA[Hi,<br />
<br />
I'm using Form Tools 2.2.6. I've installed Submission ID manager module to reset the ID counter after sending test submissions. I used the delete option and reset the ID to 1. Then I submit a test submission and it got the correct ID == 1. However, when people started to use the form the submissions ID were 39, 48, 57 and 65 (ever 9 units). How can I at least make that the ID increments in 1 instead of 9?]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I'm using Form Tools 2.2.6. I've installed Submission ID manager module to reset the ID counter after sending test submissions. I used the delete option and reset the ID to 1. Then I submit a test submission and it got the correct ID == 1. However, when people started to use the form the submissions ID were 39, 48, 57 and 65 (ever 9 units). How can I at least make that the ID increments in 1 instead of 9?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Google Recaptcha]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=27357</link>
			<pubDate>Tue, 22 Aug 2017 12:00:53 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=27357</guid>
			<description><![CDATA[Formtools Recaptcha is out of date because Google owns/runs Recaptcha now.  I hacked it in for a simple posted form without the api totally integrated, if anyone is interested in the code.]]></description>
			<content:encoded><![CDATA[Formtools Recaptcha is out of date because Google owns/runs Recaptcha now.  I hacked it in for a simple posted form without the api totally integrated, if anyone is interested in the code.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Odd, extended lag on form submit (and finalize)]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=27147</link>
			<pubDate>Tue, 15 Aug 2017 06:43:20 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=27147</guid>
			<description><![CDATA[I'm coming across an odd issue, that I've googled thoroughly, and searched on these forums as well, to no avail. Seems maybe a bit unique?<br />
<br />
We've been using FormTools for about seven years or so. I don't recall if this was an issue in the beginning, but now, the finalization of a form submission has a VERY noticeable lag. As in, 15-30 seconds long.<br />
<br />
Specifically, when a user hits the final submit button on our form (or I run a test), the page begins to process, and one can see the spinning circle on the browser tab. This goes on for an extended period, to the point where people are obviously hitting the submit button multiple times in frustration. Eventually, the submission goes through.<br />
<br />
I have narrowed down the cause to the automated emails. If I turn them off, the form submission takes only a second. The emails cause the lag whether I have SwiftMailer turned off or on. Is there something dated with the API? Is there a way to speed this up without writing custom code? Crossing my fingers that someone has resolved this already...<br />
<br />
Thanks,<br />
<br />
Mikko]]></description>
			<content:encoded><![CDATA[I'm coming across an odd issue, that I've googled thoroughly, and searched on these forums as well, to no avail. Seems maybe a bit unique?<br />
<br />
We've been using FormTools for about seven years or so. I don't recall if this was an issue in the beginning, but now, the finalization of a form submission has a VERY noticeable lag. As in, 15-30 seconds long.<br />
<br />
Specifically, when a user hits the final submit button on our form (or I run a test), the page begins to process, and one can see the spinning circle on the browser tab. This goes on for an extended period, to the point where people are obviously hitting the submit button multiple times in frustration. Eventually, the submission goes through.<br />
<br />
I have narrowed down the cause to the automated emails. If I turn them off, the form submission takes only a second. The emails cause the lag whether I have SwiftMailer turned off or on. Is there something dated with the API? Is there a way to speed this up without writing custom code? Crossing my fingers that someone has resolved this already...<br />
<br />
Thanks,<br />
<br />
Mikko]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[E-mail validation rejects valid email address]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=27127</link>
			<pubDate>Mon, 14 Aug 2017 04:58:22 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=27127</guid>
			<description><![CDATA[I used a core "Textfield" to enter "Medium &lt;= 256" text in a "Big" field width default "Max Length" and a validation for "Valid email".<br />
<br />
However a valid email address like "info@webaddress.nl" is rejected.<br />
<br />
Can I change the validation rules without having to add a custom field type and create validation rules from scratch?]]></description>
			<content:encoded><![CDATA[I used a core "Textfield" to enter "Medium &lt;= 256" text in a "Big" field width default "Max Length" and a validation for "Valid email".<br />
<br />
However a valid email address like "info@webaddress.nl" is rejected.<br />
<br />
Can I change the validation rules without having to add a custom field type and create validation rules from scratch?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Leaving form entries unfinalized - is it a problem?]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=23590</link>
			<pubDate>Sat, 15 Apr 2017 23:50:53 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=23590</guid>
			<description><![CDATA[Hi,<br />
<br />
I have a multi-page form where I want to allow users to make updates as required.<br />
<br />
Specifically, each user should have only ONE entry per table. I am not setting my users up formally in Form Tools because all of my pages are behind a membership database system and I am able to pull each user's unique member id out of that database and add it to my table so that the unique member id can still be used as a key in form tools.<br />
<br />
I can see how I can populate each form field with previously submitted data so the user can edit it. <br />
<br />
The only thing is that it seems that if I finalize the form on the last page, the user cannot go back in and edit their submission without it creating an additional entry for that user in the table.<br />
<br />
For a layman like me, the easiest thing seems to just leave the form unfinalized to allow subsequent edits/updates.<br />
<br />
The user may want to continue with subsequent edits/updates for 12 months or more.<br />
<br />
So my question is, is there a command to set the form back to "unfinalized"prior to any subsequent edits/updates and then re-set it to finalized once the subsequent edits/updates are completed, or is it OK to just leave the entries "unfinalized" over the full period of time?<br />
<br />
Looking forward to some clarification or advice.<br />
<br />
Thank you.<br />
<br />
 - Neil]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I have a multi-page form where I want to allow users to make updates as required.<br />
<br />
Specifically, each user should have only ONE entry per table. I am not setting my users up formally in Form Tools because all of my pages are behind a membership database system and I am able to pull each user's unique member id out of that database and add it to my table so that the unique member id can still be used as a key in form tools.<br />
<br />
I can see how I can populate each form field with previously submitted data so the user can edit it. <br />
<br />
The only thing is that it seems that if I finalize the form on the last page, the user cannot go back in and edit their submission without it creating an additional entry for that user in the table.<br />
<br />
For a layman like me, the easiest thing seems to just leave the form unfinalized to allow subsequent edits/updates.<br />
<br />
The user may want to continue with subsequent edits/updates for 12 months or more.<br />
<br />
So my question is, is there a command to set the form back to "unfinalized"prior to any subsequent edits/updates and then re-set it to finalized once the subsequent edits/updates are completed, or is it OK to just leave the entries "unfinalized" over the full period of time?<br />
<br />
Looking forward to some clarification or advice.<br />
<br />
Thank you.<br />
<br />
 - Neil]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Form not processing or proceeding with multi page form [solved]]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=23541</link>
			<pubDate>Fri, 14 Apr 2017 20:20:34 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=23541</guid>
			<description><![CDATA[Hi,<br />
<br />
I am attempting to create my first multi-page form using the API, but I am going crazy and getting nowhere. <img src="https://forums.formtools.org/images/smilies/sad.gif" alt="Sad" title="Sad" class="smilie smilie_8" /><br />
<br />
I have created other internal forms in form tools without issue as well as other forms in general, but am having real issues with the API.<br />
<br />
I believe I am following the instructions exactly as outlined in the docs, plus trying a few other things that seem more logical after the initial tests did not work.<br />
<br />
For example, this is what I currently have at the top of my first page (above the &lt;!DOCTYPE HTML);<br />
<br />
&lt;?php<br />
require_once("/home/mysite/public_html/ftools/global/api/api.php");<br />
&#36;fields = ft_api_init_form_page(5, "initialize");<br />
&#36;params = array(<br />
  "submit_button" =&gt; "Submit",<br />
  "next_page" =&gt; "mbh_competitive_index_1.php",<br />
  "form_data" =&gt; &#36;_POST<br />
);<br />
ft_api_process_form(&#36;params);<br />
?&gt;<br />
<br />
Now strictly speaking, the docs ONLY say to have;<br />
<br />
&#36;params = array(<br />
  "submit_button" =&gt; "submit_button_name_attribute",<br />
  "next_page" =&gt; "next_page.php",<br />
  "form_data" =&gt; &#36;_POST<br />
);<br />
<br />
(I have no file upload fields)<br />
<br />
 - on your first page instructions.  Which I tried out of fun, and that didn't work, so I wrapped it in &lt;?php ?&gt; and that didn't work either so I then extended it to what I have above - otherwise how does the first page even get the api.php code to process the form? But anyway, that is not working either.<br />
<br />
Interestingly, when I tried to delete "&#36;fields = ft_api_init_form_page(5, "initialize");" from the line above, I got a 300 error, so there is a connection trying to take place somewhere.<br />
<br />
My form code line is; &lt;form id="create-competitive-answers" action="&lt;?php echo &#36;_SERVER["PHP_SELF"]?&gt;" method="POST"&gt; - pretty much as directed.<br />
<br />
Plus my button code is; &lt;input type="submit" class="button" name="Button1" value="Submit" /&gt;<br />
<br />
On the first page of the form, I only have three hidden fields and one select and they are all properly coded.<br />
<br />
When you complete the select field and hit the "Submit" button the page refreshes, but does not proceed to the next page - nor does the selection remain in the select field. Everything just reverts back to what what was initially there. I get no error message either.<br />
<br />
I have tried just continuing on manually through all the other form pages but at no time does the script take me to the next page or the "Success!" page, and nothing is registered at Step 3, other than tell me that the line of PHP you will need is:<br />
<br />
    &#36;fields = ft_api_init_form_page(5, "initialize"); - which I have included on all pages.<br />
<br />
I have also tried putting the full URL into the "next_page" -&gt; variable without success.<br />
<br />
Sadly, there seems nothing in the docs or on this forum that seem to be able to help me further, so any assistance would be greatly appreciated.<br />
<br />
Thanks kindly,<br />
 - Neil<br />
<hr class="mycode_hr" />
OK, sorry, I think I just found it, with the problem being with my button name. :?]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I am attempting to create my first multi-page form using the API, but I am going crazy and getting nowhere. <img src="https://forums.formtools.org/images/smilies/sad.gif" alt="Sad" title="Sad" class="smilie smilie_8" /><br />
<br />
I have created other internal forms in form tools without issue as well as other forms in general, but am having real issues with the API.<br />
<br />
I believe I am following the instructions exactly as outlined in the docs, plus trying a few other things that seem more logical after the initial tests did not work.<br />
<br />
For example, this is what I currently have at the top of my first page (above the &lt;!DOCTYPE HTML);<br />
<br />
&lt;?php<br />
require_once("/home/mysite/public_html/ftools/global/api/api.php");<br />
&#36;fields = ft_api_init_form_page(5, "initialize");<br />
&#36;params = array(<br />
  "submit_button" =&gt; "Submit",<br />
  "next_page" =&gt; "mbh_competitive_index_1.php",<br />
  "form_data" =&gt; &#36;_POST<br />
);<br />
ft_api_process_form(&#36;params);<br />
?&gt;<br />
<br />
Now strictly speaking, the docs ONLY say to have;<br />
<br />
&#36;params = array(<br />
  "submit_button" =&gt; "submit_button_name_attribute",<br />
  "next_page" =&gt; "next_page.php",<br />
  "form_data" =&gt; &#36;_POST<br />
);<br />
<br />
(I have no file upload fields)<br />
<br />
 - on your first page instructions.  Which I tried out of fun, and that didn't work, so I wrapped it in &lt;?php ?&gt; and that didn't work either so I then extended it to what I have above - otherwise how does the first page even get the api.php code to process the form? But anyway, that is not working either.<br />
<br />
Interestingly, when I tried to delete "&#36;fields = ft_api_init_form_page(5, "initialize");" from the line above, I got a 300 error, so there is a connection trying to take place somewhere.<br />
<br />
My form code line is; &lt;form id="create-competitive-answers" action="&lt;?php echo &#36;_SERVER["PHP_SELF"]?&gt;" method="POST"&gt; - pretty much as directed.<br />
<br />
Plus my button code is; &lt;input type="submit" class="button" name="Button1" value="Submit" /&gt;<br />
<br />
On the first page of the form, I only have three hidden fields and one select and they are all properly coded.<br />
<br />
When you complete the select field and hit the "Submit" button the page refreshes, but does not proceed to the next page - nor does the selection remain in the select field. Everything just reverts back to what what was initially there. I get no error message either.<br />
<br />
I have tried just continuing on manually through all the other form pages but at no time does the script take me to the next page or the "Success!" page, and nothing is registered at Step 3, other than tell me that the line of PHP you will need is:<br />
<br />
    &#36;fields = ft_api_init_form_page(5, "initialize"); - which I have included on all pages.<br />
<br />
I have also tried putting the full URL into the "next_page" -&gt; variable without success.<br />
<br />
Sadly, there seems nothing in the docs or on this forum that seem to be able to help me further, so any assistance would be greatly appreciated.<br />
<br />
Thanks kindly,<br />
 - Neil<br />
<hr class="mycode_hr" />
OK, sorry, I think I just found it, with the problem being with my button name. :?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[External Form Security]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=19868</link>
			<pubDate>Sun, 15 Jan 2017 09:07:48 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=19868</guid>
			<description><![CDATA[Hi all,<br />
First post for me, and I begin by saying that FormTools is brilliant!<br />
<br />
One slight concern I have, though I will be happy to admit if this is an error on my part is that when using external forms I cannot seem to get my one external form to stick to the access policy defined when setting up the form. At the moment anyone and everyone (including not logged in) can access my external form even when the form is set to Adminstrator Only access.<br />
<br />
I have searched the forum for a fix to this but cannot find anything.<br />
<br />
Can someone suggest a solution to this?<br />
<br />
Many thanks in advance.]]></description>
			<content:encoded><![CDATA[Hi all,<br />
First post for me, and I begin by saying that FormTools is brilliant!<br />
<br />
One slight concern I have, though I will be happy to admit if this is an error on my part is that when using external forms I cannot seem to get my one external form to stick to the access policy defined when setting up the form. At the moment anyone and everyone (including not logged in) can access my external form even when the form is set to Adminstrator Only access.<br />
<br />
I have searched the forum for a fix to this but cannot find anything.<br />
<br />
Can someone suggest a solution to this?<br />
<br />
Many thanks in advance.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Beginner: how to link a field to an existing field in a MYSQL Database]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=19432</link>
			<pubDate>Fri, 06 Jan 2017 10:30:26 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=19432</guid>
			<description><![CDATA[Hi,<br />
I am a beginner with FormTools. How can you link a new form to an existing Mysql data base on my webserver.<br />
The FormTools is installed on my Webserver too.<br />
I have not found any documentation which describes how to link the fields of the form with the fields in the database.<br />
Please inform.]]></description>
			<content:encoded><![CDATA[Hi,<br />
I am a beginner with FormTools. How can you link a new form to an existing Mysql data base on my webserver.<br />
The FormTools is installed on my Webserver too.<br />
I have not found any documentation which describes how to link the fields of the form with the fields in the database.<br />
Please inform.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Google Maps API error message]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=14271</link>
			<pubDate>Tue, 02 Aug 2016 14:52:22 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=14271</guid>
			<description><![CDATA[Hi,<br />
<br />
Any help you can provide is appreciated.<br />
<br />
I've got a form going that has all the fields I need but I cannot see where I to add my googlemaps api key.<br />
<br />
The google api is working on another form I've created, but I don't see where I should add the code on the specific page.<br />
<br />
This is what I have in the code of the working page, and I get the desired return: &lt;script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzaSy...XPmPzenU&amp;libraries=places"&gt;&lt;/script&gt;<br />
<br />
Can someone please advise me on where I would need to add the code in this page: <a href="http://mindworksnet.org/video/errormsg.png" target="_blank" class="mycode_url">TEST PAGE</a>. As far as I can tell, the page is the edit_subscription page, which I can get to, however, I would like to be sure this is correct before going too far...<br />
<br />
Thank, in advance...]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
Any help you can provide is appreciated.<br />
<br />
I've got a form going that has all the fields I need but I cannot see where I to add my googlemaps api key.<br />
<br />
The google api is working on another form I've created, but I don't see where I should add the code on the specific page.<br />
<br />
This is what I have in the code of the working page, and I get the desired return: &lt;script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzaSy...XPmPzenU&amp;libraries=places"&gt;&lt;/script&gt;<br />
<br />
Can someone please advise me on where I would need to add the code in this page: <a href="http://mindworksnet.org/video/errormsg.png" target="_blank" class="mycode_url">TEST PAGE</a>. As far as I can tell, the page is the edit_subscription page, which I can get to, however, I would like to be sure this is correct before going too far...<br />
<br />
Thank, in advance...]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Getting Browser Information]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=13049</link>
			<pubDate>Thu, 02 Jun 2016 13:32:49 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=13049</guid>
			<description><![CDATA[Is there some way to record the type/version of browser the user is using when submitting a form? I've gotten a few submissions that seemingly bypass all the validation rules (PHP), with no explanation. I'd like to narrow it down further. Thinking that maybe they are using some ancient browser or something?]]></description>
			<content:encoded><![CDATA[Is there some way to record the type/version of browser the user is using when submitting a form? I've gotten a few submissions that seemingly bypass all the validation rules (PHP), with no explanation. I'd like to narrow it down further. Thinking that maybe they are using some ancient browser or something?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Deleted records - reappearing!!]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=11930</link>
			<pubDate>Wed, 24 Feb 2016 02:53:02 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=11930</guid>
			<description><![CDATA[Sometimes, records deleted in formtools - that appear deleted, are re-appearing in the database table - but with 'NULL' values - it seems to happen after visiting the tank you page after deleting the record. Using API]]></description>
			<content:encoded><![CDATA[Sometimes, records deleted in formtools - that appear deleted, are re-appearing in the database table - but with 'NULL' values - it seems to happen after visiting the tank you page after deleting the record. Using API]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Form submits data but 500 error after]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=11088</link>
			<pubDate>Fri, 08 Jan 2016 20:38:15 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=11088</guid>
			<description><![CDATA[Hello,<br />
<br />
I'm using an API form that was working fine until I tried to make some changes to the form code (a select field). The first time I tested the changes I got an Error 500, a now I keep getting the errors even after reverting the changes. <br />
<br />
The form is able to store the information in the database but I don't get to the Thank you page or get the swift emails. The problem is only on one form. My other forms work well.<br />
<br />
Another thing I noticed is that the session stays open since it never gets to the Thank you page so I have to manually load the Thank you page to close the session.<br />
<br />
Any ideas would be greatly appreciated.<br />
<hr class="mycode_hr" />
Here is my code:<br />
<br />
&lt;?php<br />
<br />
require_once("../global/api/api.php");<br />
&#36;fields = ft_api_init_form_page("30"); // X would be your form ID<br />
 <br />
// validation time!<br />
<br />
&#36;errors = array();<br />
if (isset(&#36;_POST['submit']))<br />
{<br />
  &#36;rules = array();<br />
  &#36;rules[] = "required,first_name,01First Name is required.";<br />
  &#36;rules[] = "required,last_name,02Last Name is required.";<br />
  &#36;rules[] = "required,home_address,03Home Address is required.";<br />
  &#36;rules[] = "required,city,47City is required.";<br />
  &#36;rules[] = "required,zip_code,48Zipcode is required.";<br />
  &#36;rules[] = "required,state,04State is required.";<br />
  &#36;rules[] = "required,mobile_phone,05Mobile Phone is required.";<br />
  &#36;rules[] = "required,email,06Email is required.";<br />
  &#36;rules[] = "required,fullname,07Full Name is required.";<br />
  &#36;rules[] = "required,place_birth,08Place of Birth is required.";<br />
  &#36;rules[] = "required,nationality,09Nationality is required.";<br />
  &#36;rules[] = "required,dob_mm,10Date of Birth is required.";<br />
  &#36;rules[] = "required,dob_dd,11Date of Birth is required.";<br />
  &#36;rules[] = "required,dob_yy,12Date of Birth is required.";<br />
  &#36;rules[] = "required,gender,13Gender is required.";<br />
  &#36;rules[] = "required,passport_number,14Passport Number is required.";<br />
  &#36;rules[] = "required,place_issue,15Passport Place of Issue is required.";<br />
  &#36;rules[] = "required,exp_mm,16Passport Expiration Date is required.";<br />
  &#36;rules[] = "required,exp_dd,17Passport Expiration Date  is required.";<br />
  &#36;rules[] = "required,exp_yy,18Passport Expiration Date  is required.";<br />
  &#36;rules[] = "required,agent,19Agent is required.";<br />
  //&#36;rules[] = "required,corp_card_year,50Expiration Date is required.";<br />
<br />
  <br />
  <br />
<br />
  &#36;rules[] = "valid_email,email,30Please enter a valid email address.";<br />
  <br />
 // &#36;rules[] = "digits_only,zip_code,31Please enter a valid Zip Code.";<br />
  &#36;rules[] = "digits_only,mobile_phone,32Please enter a valid Mobile Number";<br />
  &#36;rules[] = "digits_only,home_phone,33Please enter a valid Home Number.";<br />
  &#36;rules[] = "digits_only,work_phone,34Please enter a valid Work Number.";<br />
  &#36;rules[] = "digits_only,cc1,35Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cc2,36Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cc3,37Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cc4,38Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cvc_code,39Please enter a valid CVC Code";<br />
  &#36;rules[] = "digits_only,billing_zip,40Please enter a valid Zip Code.";<br />
  &#36;rules[] = "digits_only,corp_cc1,41Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_cc2,42Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_cc3,43Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_cc4,44Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_card_cvc,45Please enter a valid CVC Number.";<br />
  &#36;rules[] = "digits_only,corp_card_zip,46Please enter a valid Zip Code.";<br />
  &#36;rules[] = "valid_email,assistant_email,49Please enter a valid email.";<br />
 <br />
  &#36;errors = validate_fields(&#36;_POST, &#36;rules);<br />
 <br />
  // no errors - great! Now we process the page. The ft_api_process_form does<br />
  // the job of both updating the database and redirecting to the next page<br />
if (empty(&#36;errors))<br />
	{<br />
	&#36;params = array(<br />
	  "submit_button" =&gt; "submit",<br />
	  "next_page" =&gt; "thanks.php",<br />
	  "form_data" =&gt; &#36;_POST,<br />
	  "finalize" =&gt; true<br />
		);<br />
	ft_api_process_form(&#36;params);<br />
	}<br />
// it failed validation. Update &#36;fields with the latest contents of the form data<br />
else <br />
  {<br />
    &#36;fields = array_merge(&#36;_SESSION["form_tools_form"], &#36;_POST);<br />
  }<br />
}<br />
?&gt;]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I'm using an API form that was working fine until I tried to make some changes to the form code (a select field). The first time I tested the changes I got an Error 500, a now I keep getting the errors even after reverting the changes. <br />
<br />
The form is able to store the information in the database but I don't get to the Thank you page or get the swift emails. The problem is only on one form. My other forms work well.<br />
<br />
Another thing I noticed is that the session stays open since it never gets to the Thank you page so I have to manually load the Thank you page to close the session.<br />
<br />
Any ideas would be greatly appreciated.<br />
<hr class="mycode_hr" />
Here is my code:<br />
<br />
&lt;?php<br />
<br />
require_once("../global/api/api.php");<br />
&#36;fields = ft_api_init_form_page("30"); // X would be your form ID<br />
 <br />
// validation time!<br />
<br />
&#36;errors = array();<br />
if (isset(&#36;_POST['submit']))<br />
{<br />
  &#36;rules = array();<br />
  &#36;rules[] = "required,first_name,01First Name is required.";<br />
  &#36;rules[] = "required,last_name,02Last Name is required.";<br />
  &#36;rules[] = "required,home_address,03Home Address is required.";<br />
  &#36;rules[] = "required,city,47City is required.";<br />
  &#36;rules[] = "required,zip_code,48Zipcode is required.";<br />
  &#36;rules[] = "required,state,04State is required.";<br />
  &#36;rules[] = "required,mobile_phone,05Mobile Phone is required.";<br />
  &#36;rules[] = "required,email,06Email is required.";<br />
  &#36;rules[] = "required,fullname,07Full Name is required.";<br />
  &#36;rules[] = "required,place_birth,08Place of Birth is required.";<br />
  &#36;rules[] = "required,nationality,09Nationality is required.";<br />
  &#36;rules[] = "required,dob_mm,10Date of Birth is required.";<br />
  &#36;rules[] = "required,dob_dd,11Date of Birth is required.";<br />
  &#36;rules[] = "required,dob_yy,12Date of Birth is required.";<br />
  &#36;rules[] = "required,gender,13Gender is required.";<br />
  &#36;rules[] = "required,passport_number,14Passport Number is required.";<br />
  &#36;rules[] = "required,place_issue,15Passport Place of Issue is required.";<br />
  &#36;rules[] = "required,exp_mm,16Passport Expiration Date is required.";<br />
  &#36;rules[] = "required,exp_dd,17Passport Expiration Date  is required.";<br />
  &#36;rules[] = "required,exp_yy,18Passport Expiration Date  is required.";<br />
  &#36;rules[] = "required,agent,19Agent is required.";<br />
  //&#36;rules[] = "required,corp_card_year,50Expiration Date is required.";<br />
<br />
  <br />
  <br />
<br />
  &#36;rules[] = "valid_email,email,30Please enter a valid email address.";<br />
  <br />
 // &#36;rules[] = "digits_only,zip_code,31Please enter a valid Zip Code.";<br />
  &#36;rules[] = "digits_only,mobile_phone,32Please enter a valid Mobile Number";<br />
  &#36;rules[] = "digits_only,home_phone,33Please enter a valid Home Number.";<br />
  &#36;rules[] = "digits_only,work_phone,34Please enter a valid Work Number.";<br />
  &#36;rules[] = "digits_only,cc1,35Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cc2,36Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cc3,37Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cc4,38Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,cvc_code,39Please enter a valid CVC Code";<br />
  &#36;rules[] = "digits_only,billing_zip,40Please enter a valid Zip Code.";<br />
  &#36;rules[] = "digits_only,corp_cc1,41Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_cc2,42Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_cc3,43Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_cc4,44Please enter a valid Credit Card Number.";<br />
  &#36;rules[] = "digits_only,corp_card_cvc,45Please enter a valid CVC Number.";<br />
  &#36;rules[] = "digits_only,corp_card_zip,46Please enter a valid Zip Code.";<br />
  &#36;rules[] = "valid_email,assistant_email,49Please enter a valid email.";<br />
 <br />
  &#36;errors = validate_fields(&#36;_POST, &#36;rules);<br />
 <br />
  // no errors - great! Now we process the page. The ft_api_process_form does<br />
  // the job of both updating the database and redirecting to the next page<br />
if (empty(&#36;errors))<br />
	{<br />
	&#36;params = array(<br />
	  "submit_button" =&gt; "submit",<br />
	  "next_page" =&gt; "thanks.php",<br />
	  "form_data" =&gt; &#36;_POST,<br />
	  "finalize" =&gt; true<br />
		);<br />
	ft_api_process_form(&#36;params);<br />
	}<br />
// it failed validation. Update &#36;fields with the latest contents of the form data<br />
else <br />
  {<br />
    &#36;fields = array_merge(&#36;_SESSION["form_tools_form"], &#36;_POST);<br />
  }<br />
}<br />
?&gt;]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Custom Login Page for submission_accounts]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=11070</link>
			<pubDate>Thu, 07 Jan 2016 11:13:27 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=11070</guid>
			<description><![CDATA[Hi,<br />
<br />
Do we have API to connect custom login page with submission_accounts module login page to edit the user entered data? Please any one reply.<br />
<br />
Thanks in advance.<br />
<br />
Thanks<br />
<hr class="mycode_hr" />
Hi All,<br />
<br />
I found the solutions. Thanks for this great tool. <br />
<br />
If any newbee need help, please ping me.<br />
<br />
<blockquote class="mycode_quote"><cite><span> (Jan 7th, 2016, 11:13 AM)</span>formuser Wrote:  <a href="https://forums.formtools.org/showthread.php?pid=18513#pid18513" class="quick_jump"></a></cite>Hi,<br />
<br />
Do we have API to connect custom login page with submission_accounts module login page to edit the user entered data? Please any one reply.<br />
<br />
Thanks in advance.<br />
<br />
Thanks</blockquote>]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
Do we have API to connect custom login page with submission_accounts module login page to edit the user entered data? Please any one reply.<br />
<br />
Thanks in advance.<br />
<br />
Thanks<br />
<hr class="mycode_hr" />
Hi All,<br />
<br />
I found the solutions. Thanks for this great tool. <br />
<br />
If any newbee need help, please ping me.<br />
<br />
<blockquote class="mycode_quote"><cite><span> (Jan 7th, 2016, 11:13 AM)</span>formuser Wrote:  <a href="https://forums.formtools.org/showthread.php?pid=18513#pid18513" class="quick_jump"></a></cite>Hi,<br />
<br />
Do we have API to connect custom login page with submission_accounts module login page to edit the user entered data? Please any one reply.<br />
<br />
Thanks in advance.<br />
<br />
Thanks</blockquote>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[HELP!!! FORM sending information to e-mail]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5240</link>
			<pubDate>Fri, 10 Jul 2015 14:40:37 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5240</guid>
			<description><![CDATA[Explained<br />
<br />
I have my forms to fill and clicking the button "submmit" I did not come in the mail.<br />
<br />
Could you help me ??<br />
<br />
before it worked perfectly !!<br />
<br />
as I can solve it?<br />
<br />
<br />
<br />
my English language is bad !!]]></description>
			<content:encoded><![CDATA[Explained<br />
<br />
I have my forms to fill and clicking the button "submmit" I did not come in the mail.<br />
<br />
Could you help me ??<br />
<br />
before it worked perfectly !!<br />
<br />
as I can solve it?<br />
<br />
<br />
<br />
my English language is bad !!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Return field value]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5218</link>
			<pubDate>Mon, 22 Jun 2015 05:26:40 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5218</guid>
			<description><![CDATA[Hi,<br />
<br />
I'm using the api to retrieve submissions which works well. However my dropdown list has the following entries....<br />
<br />
Order    Field Value           Display Text<br />
 1          ami-f5f86b82       Centos6-template-clean<br />
<br />
But when I try and get the information back in an xml format I only ever get the display text.<br />
<br />
How can I retrieve the Filed value instead?<br />
<br />
This is the code I'm using.....<br />
<br />
&lt;?php<br />
require("global/api/api.php");<br />
&#36;page = ft_api_load_field("page", "page", 1);<br />
ft_api_show_submissions(1, 1, 7, &#36;return_as_string);<br />
?&gt;<br />
<br />
And this is the result.....<br />
<br />
                                &lt;submission_id&gt;&lt;![CDATA[13]]]]&gt;&lt;![CDATA[&gt;&lt;/submission_id&gt;<br />
                                 &lt;col_1&gt;&lt;![CDATA[*****]]]]&gt;&lt;![CDATA[&gt;&lt;/col_1&gt;<br />
                                 &lt;col_2&gt;&lt;![CDATA[t2.micro]]]]&gt;&lt;![CDATA[&gt;&lt;/col_2&gt;<br />
                                 &lt;col_3&gt;&lt;![CDATA[default]]]]&gt;&lt;![CDATA[&gt;&lt;/col_3&gt;<br />
                                 &lt;col_4&gt;&lt;![CDATA[Centos6-template-clean]]]]&gt;&lt;![CDATA[&gt;&lt;/col_4&gt;<br />
                                 &lt;col_5&gt;&lt;![CDATA[EU (Ireland)]]]]&gt;&lt;![CDATA[&gt;&lt;/col_5&gt;<br />
                                 &lt;submission_date&gt;&lt;![CDATA[2015-06-22 11:50 AM]]]]&gt;&lt;![CDATA[&gt;&lt;/submission_date&gt;<br />
                                 &lt;last_modified_date&gt;&lt;![CDATA[2015-06-22 12:14 PM]]]]&gt;&lt;![CDATA[&gt;&lt;/last_modified_date&gt;<br />
                                 &lt;ip_address&gt;&lt;![CDATA[********]]]]&gt;&lt;![CDATA[&gt;&lt;/ip_address&gt;<br />
<br />
Any ideas?<br />
<br />
Cheers,<br />
<br />
Neil]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I'm using the api to retrieve submissions which works well. However my dropdown list has the following entries....<br />
<br />
Order    Field Value           Display Text<br />
 1          ami-f5f86b82       Centos6-template-clean<br />
<br />
But when I try and get the information back in an xml format I only ever get the display text.<br />
<br />
How can I retrieve the Filed value instead?<br />
<br />
This is the code I'm using.....<br />
<br />
&lt;?php<br />
require("global/api/api.php");<br />
&#36;page = ft_api_load_field("page", "page", 1);<br />
ft_api_show_submissions(1, 1, 7, &#36;return_as_string);<br />
?&gt;<br />
<br />
And this is the result.....<br />
<br />
                                &lt;submission_id&gt;&lt;![CDATA[13]]]]&gt;&lt;![CDATA[&gt;&lt;/submission_id&gt;<br />
                                 &lt;col_1&gt;&lt;![CDATA[*****]]]]&gt;&lt;![CDATA[&gt;&lt;/col_1&gt;<br />
                                 &lt;col_2&gt;&lt;![CDATA[t2.micro]]]]&gt;&lt;![CDATA[&gt;&lt;/col_2&gt;<br />
                                 &lt;col_3&gt;&lt;![CDATA[default]]]]&gt;&lt;![CDATA[&gt;&lt;/col_3&gt;<br />
                                 &lt;col_4&gt;&lt;![CDATA[Centos6-template-clean]]]]&gt;&lt;![CDATA[&gt;&lt;/col_4&gt;<br />
                                 &lt;col_5&gt;&lt;![CDATA[EU (Ireland)]]]]&gt;&lt;![CDATA[&gt;&lt;/col_5&gt;<br />
                                 &lt;submission_date&gt;&lt;![CDATA[2015-06-22 11:50 AM]]]]&gt;&lt;![CDATA[&gt;&lt;/submission_date&gt;<br />
                                 &lt;last_modified_date&gt;&lt;![CDATA[2015-06-22 12:14 PM]]]]&gt;&lt;![CDATA[&gt;&lt;/last_modified_date&gt;<br />
                                 &lt;ip_address&gt;&lt;![CDATA[********]]]]&gt;&lt;![CDATA[&gt;&lt;/ip_address&gt;<br />
<br />
Any ideas?<br />
<br />
Cheers,<br />
<br />
Neil]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[XSS Prevention of PHP Injection]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5208</link>
			<pubDate>Fri, 12 Jun 2015 13:26:13 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5208</guid>
			<description><![CDATA[Recently, a PCI audit revealed a cross site scripting vulnerability in some of the forms I had developed for my clients. If I understand the terminology correctly, it is based on PHP Injection. Basically, since the form action of an external form (utilizing the API) is:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">form action</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;?php echo </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"</span><span style="color: #0000BB">PHP_SELF</span><span style="color: #DD0000">"</span><span style="color: #007700">]</span><span style="color: #DD0000">?&gt;" </span><span style="color: #0000BB">method</span><span style="color: #007700">=</span><span style="color: #DD0000">"post"</span><span style="color: #007700">&gt; <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Then the URL can be used to execute scripts as variables in the URL.<br />
<br />
There's ample documentation about this being a well known problem. There are also lots of forums around the WWW with potential fixes.<br />
<br />
Since I don't pretend to understand PHP as a programming language, I have to have assumed that Joe and Ben intended the form action for a reason. And then I read the tutorial on <a href="http://docs.formtools.org/tutorials/api_single_page_form/?page=step1" target="_blank" class="mycode_url">adding a single page form with the API</a>. It was then that I realized the form action being PHP_SELF was only out of convenience to the web developer. For example, we could, instead, use the file path as the form action, but if we ever changed the file path (or it's filename), we would need to remember to change the form action, as well.<br />
<br />
That said, I have now opted to edit all of my external forms to utilize a hard-coded form action URL, like this:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">form action</span><span style="color: #007700">=</span><span style="color: #DD0000">"https://www.domain.com/filename.php" </span><span style="color: #0000BB">method</span><span style="color: #007700">=</span><span style="color: #DD0000">"post"</span><span style="color: #007700">&gt; <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Obviously, you would want to replace <span style="font-weight: bold;" class="mycode_b">domain</span> and <span style="font-weight: bold;" class="mycode_b">filename</span> with your own values.<br />
<br />
While the tutorial I mentioned above actually states:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>It's generally a better idea to use &#36;_SERVER["PHP_SELF"] instead of the name of the file, since filenames sometimes change. If that happens, you'd need to remember to update the action attribute. But by using the PHP variable, you don't have to worry about it!</blockquote>
<br />
It is actually better if you use the name of the file, to prevent potential XSS attacks on the form submission. You'll just need to remember to change the form action if the name of the file changes.<br />
<br />
Before I realized all of this, I DID actually come across another potential solution, which should prevent the URL from being appended. However, I'm also fairly certain the code I found is bloated a bit, since it wasn't programmed specifically for FormTools. I just don't know PHP well enough to strip it down. It does, however, prevent the PCI scans from flagging the XSS vulnerability.<br />
<br />
I would like to actually store this code in a separate file and call the file from the top of all of my forms, for convenience, but I'm not entirely sure how to do that, either. This is really sort of irrelevant now, though, since I'm now using the full path in the form's action attribute, instead of PHP_SELF.<br />
<br />
If this code could be tested by Ben/Joe, perhaps it could be implemented in the core, to help prevent XSS attacks on forms utilizing the API. The code I found is:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
    </span><span style="color: #FF8000">// XSS prevention<br />
    </span><span style="color: #007700">if (isset (</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'ORIG_PATH_INFO'</span><span style="color: #007700">]) &amp;&amp; </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'ORIG_PATH_INFO'</span><span style="color: #007700">] != </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">]) {<br />
        </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">] = </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'ORIG_PATH_INFO'</span><span style="color: #007700">];<br />
    }<br />
    </span><span style="color: #FF8000">// Security measure, to avoid XSS exploit.<br />
    </span><span style="color: #007700">if (!empty (</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">]) &amp;&amp; </span><span style="color: #0000BB">strrpos </span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">])) {<br />
        </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">] = </span><span style="color: #0000BB">substr </span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">], </span><span style="color: #0000BB">0</span><span style="color: #007700">, -(</span><span style="color: #0000BB">strlen </span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">])));<br />
    } <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Hopefully this all makes sense to someone.]]></description>
			<content:encoded><![CDATA[Recently, a PCI audit revealed a cross site scripting vulnerability in some of the forms I had developed for my clients. If I understand the terminology correctly, it is based on PHP Injection. Basically, since the form action of an external form (utilizing the API) is:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">form action</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;?php echo </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"</span><span style="color: #0000BB">PHP_SELF</span><span style="color: #DD0000">"</span><span style="color: #007700">]</span><span style="color: #DD0000">?&gt;" </span><span style="color: #0000BB">method</span><span style="color: #007700">=</span><span style="color: #DD0000">"post"</span><span style="color: #007700">&gt; <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Then the URL can be used to execute scripts as variables in the URL.<br />
<br />
There's ample documentation about this being a well known problem. There are also lots of forums around the WWW with potential fixes.<br />
<br />
Since I don't pretend to understand PHP as a programming language, I have to have assumed that Joe and Ben intended the form action for a reason. And then I read the tutorial on <a href="http://docs.formtools.org/tutorials/api_single_page_form/?page=step1" target="_blank" class="mycode_url">adding a single page form with the API</a>. It was then that I realized the form action being PHP_SELF was only out of convenience to the web developer. For example, we could, instead, use the file path as the form action, but if we ever changed the file path (or it's filename), we would need to remember to change the form action, as well.<br />
<br />
That said, I have now opted to edit all of my external forms to utilize a hard-coded form action URL, like this:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">form action</span><span style="color: #007700">=</span><span style="color: #DD0000">"https://www.domain.com/filename.php" </span><span style="color: #0000BB">method</span><span style="color: #007700">=</span><span style="color: #DD0000">"post"</span><span style="color: #007700">&gt; <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Obviously, you would want to replace <span style="font-weight: bold;" class="mycode_b">domain</span> and <span style="font-weight: bold;" class="mycode_b">filename</span> with your own values.<br />
<br />
While the tutorial I mentioned above actually states:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>It's generally a better idea to use &#36;_SERVER["PHP_SELF"] instead of the name of the file, since filenames sometimes change. If that happens, you'd need to remember to update the action attribute. But by using the PHP variable, you don't have to worry about it!</blockquote>
<br />
It is actually better if you use the name of the file, to prevent potential XSS attacks on the form submission. You'll just need to remember to change the form action if the name of the file changes.<br />
<br />
Before I realized all of this, I DID actually come across another potential solution, which should prevent the URL from being appended. However, I'm also fairly certain the code I found is bloated a bit, since it wasn't programmed specifically for FormTools. I just don't know PHP well enough to strip it down. It does, however, prevent the PCI scans from flagging the XSS vulnerability.<br />
<br />
I would like to actually store this code in a separate file and call the file from the top of all of my forms, for convenience, but I'm not entirely sure how to do that, either. This is really sort of irrelevant now, though, since I'm now using the full path in the form's action attribute, instead of PHP_SELF.<br />
<br />
If this code could be tested by Ben/Joe, perhaps it could be implemented in the core, to help prevent XSS attacks on forms utilizing the API. The code I found is:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
    </span><span style="color: #FF8000">// XSS prevention<br />
    </span><span style="color: #007700">if (isset (</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'ORIG_PATH_INFO'</span><span style="color: #007700">]) &amp;&amp; </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'ORIG_PATH_INFO'</span><span style="color: #007700">] != </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">]) {<br />
        </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">] = </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'ORIG_PATH_INFO'</span><span style="color: #007700">];<br />
    }<br />
    </span><span style="color: #FF8000">// Security measure, to avoid XSS exploit.<br />
    </span><span style="color: #007700">if (!empty (</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">]) &amp;&amp; </span><span style="color: #0000BB">strrpos </span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">])) {<br />
        </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">] = </span><span style="color: #0000BB">substr </span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PHP_SELF'</span><span style="color: #007700">], </span><span style="color: #0000BB">0</span><span style="color: #007700">, -(</span><span style="color: #0000BB">strlen </span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'PATH_INFO'</span><span style="color: #007700">])));<br />
    } <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Hopefully this all makes sense to someone.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[After the submit bug in the redirect to the succes.php]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5151</link>
			<pubDate>Wed, 06 May 2015 08:05:27 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5151</guid>
			<description><![CDATA[Hi, <br />
I have been trying integrating formtools through the API,  I have reviewed all Threats related, and I do not know why once the completed form (and sent correctly) no forwarding is executed to the page succes.php (which in my case it is called formulariook.php)<br />
<br />
This is the URL of the form:<br />
<br />
<a href="http://www.coachingwingwave.cat/contacto.php" target="_blank" class="mycode_url">http://www.coachingwingwave.cat/contacto.php</a><br />
<br />
Here I leave the code that I have in the form page:<br />
<br />
&lt;Form action = "&lt;? Php echo &#36; _SERVER ['PHP_SELF']?&gt;" Method = "post"&gt;<br />
    <br />
&lt;? Php<br />
require_once ("/home/adminjoaquimb/public_html/formtools/global/api/api.php");<br />
&#36; Fields = ft_api_init_form_page (5);<br />
&#36; Params = array (<br />
  "Submit_button" =&gt; "submit"<br />
  "Next_page" =&gt; "contactoformulariook.php"<br />
  "Form_data" =&gt; &#36; _POST,<br />
  "Finalize" =&gt; true<br />
    );<br />
ft_api_process_form (&#36; params);<br />
?&gt;<br />
<br />
And this in succes.php page (formulariook.php)<br />
<br />
&lt;? Php<br />
require_once ('/ home / adminjoaquimb / public_html / formtools / global / api / api.php ");<br />
&#36; Fields = ft_api_init_form_page ();<br />
ft_api_clear_form_sessions ();<br />
?&gt;<br />
<br />
I tried to change and try everything but I can not make it work well, does anyone know what is happening? .. Thanks in advance,<br />
Regards<br />
Victor]]></description>
			<content:encoded><![CDATA[Hi, <br />
I have been trying integrating formtools through the API,  I have reviewed all Threats related, and I do not know why once the completed form (and sent correctly) no forwarding is executed to the page succes.php (which in my case it is called formulariook.php)<br />
<br />
This is the URL of the form:<br />
<br />
<a href="http://www.coachingwingwave.cat/contacto.php" target="_blank" class="mycode_url">http://www.coachingwingwave.cat/contacto.php</a><br />
<br />
Here I leave the code that I have in the form page:<br />
<br />
&lt;Form action = "&lt;? Php echo &#36; _SERVER ['PHP_SELF']?&gt;" Method = "post"&gt;<br />
    <br />
&lt;? Php<br />
require_once ("/home/adminjoaquimb/public_html/formtools/global/api/api.php");<br />
&#36; Fields = ft_api_init_form_page (5);<br />
&#36; Params = array (<br />
  "Submit_button" =&gt; "submit"<br />
  "Next_page" =&gt; "contactoformulariook.php"<br />
  "Form_data" =&gt; &#36; _POST,<br />
  "Finalize" =&gt; true<br />
    );<br />
ft_api_process_form (&#36; params);<br />
?&gt;<br />
<br />
And this in succes.php page (formulariook.php)<br />
<br />
&lt;? Php<br />
require_once ('/ home / adminjoaquimb / public_html / formtools / global / api / api.php ");<br />
&#36; Fields = ft_api_init_form_page ();<br />
ft_api_clear_form_sessions ();<br />
?&gt;<br />
<br />
I tried to change and try everything but I can not make it work well, does anyone know what is happening? .. Thanks in advance,<br />
Regards<br />
Victor]]></content:encoded>
		</item>
	</channel>
</rss>