root/trunk/website/blog/cfformprotect/cffp.cfm @ 17

Revision 5, 2.2 kB (checked in by DanWilson, 17 years ago)

Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)

Line 
1<!--- This path should start from the web root and work forward from
2                        there, if you don't have it in the web root --->
3<cfset cffpPath = "cfformprotect">
4
5<!--- load the file that grabs all values from the ini file --->
6<cfinclude template="cffpConfig.cfm">
7
8<!--- check the config (from the ini file)to see if each test is turned on --->
9<cfif cffpConfig.mouseMovement>
10        <!--- If the user moves their mouse, put the distance in this field (JavaScript function handles this).
11                                cffpVerify.cfm will make sure the user at least used their keyboard. A spam
12                                bot won't trigger this --->
13        <input type="hidden" name="formfield1234567891" id="formfield1234567891" value="">
14        <cfhtmlhead text="<script type='text/javascript' src='#cffpPath#/js/mouseMovement.js'></script>">
15</cfif>
16
17<cfif cffpConfig.usedKeyboard>
18        <!--- If the types on their keyboard, put the amount of keys pressed in this field.
19                                cffpVerify.cfm will make sure the user at least used their keyboard. A spam
20                                bot won't trigger this --->
21        <input type="hidden" name="formfield1234567892" id="formfield1234567892" value="">
22        <cfhtmlhead text="<script type='text/javascript' src='#cffpPath#/js/usedKeyboard.js'></script>">
23</cfif>
24
25<cfif cffpConfig.timedFormSubmission>
26        <!--- in cffpVerify.cfm I will verify that the amount of time it took to
27                                fill out this form is 'normal' (the time limits are set in the ini file)--->
28        <!--- get the current time, obfuscate it and load it to this hidden field --->
29        <cfset currentDate = dateFormat(now(),'yyyymmdd')>
30        <cfset currentTime = timeFormat(now(),'HHmmss')>
31        <!--- Add an arbitrary number to the date/time values to mask them from prying eyes --->
32        <cfset blurredDate = currentDate+19740206>
33        <cfset blurredTime = currentTime+19740206>
34        <input type="hidden" name="formfield1234567893" value="<cfoutput>#blurredDate#,#blurredTime#</cfoutput>">
35</cfif>
36
37<cfif cffpConfig.hiddenFormField>
38        <!--- A lot of spam bots automatically fill in all form fields.  cffpVerify.cfm will
39                                test to see if this field is blank. The "leave this empty" text is there for blind people,
40                                who might see this hidden field --->
41        <span style="display:none">Leave this field empty <input type="text" name="formfield1234567894" value=""></span>
42</cfif>
Note: See TracBrowser for help on using the browser.