For a quick and dirty fix, Mike, you might try something like this on  
one of your inputs:

<script type="text/javascript" language="javascript">
function makeHuman(input,element){
if(!document.getElementById("ishuman")){
var formText = element.innerHTML;
var ivalue = input.value;
var iid = input.getAttribute("id");
var hinput = "<input type=\"hidden\" name=\"ishuman\" id=\"ishuman\"  
value=\"true\"\/>";
element.innerHTML = formText+hinput;
//Need to rewrite the blurred field value since the blur event doesn't  
set the DOM value
document.getElementById(iid).value = ivalue;
};
};
</script>
<input type="text" name="myinput" id="myinput" value=""  
onblur="makeHuman(this,this.parentNode);"/>

this will use javascript to write a hidden input in the form.   Then  
you can validate your form by wrapping your logic with:

<cfif structKeyExists(form,"ishuman")  and form.ishuman>

[processing code here]

</cfif>

This will take care of everything but direct input by a person in a  
javascript enabled browser.  For better results, you place the script  
in one of your site .js files.  As was said earlier, sometimes the  
spammers use a human to capture the form values an then plug it in to  
their software for spamming runs.

  Captcha's are an easy solution too, as suggested earlier.

HTH,

Jon

On Nov 15, 2007, at 4:45 PM, Mike Little wrote:

> just a quick update guys (and thank you for the many replies!!)..
>
> the following code has not made a lick of difference on the  
> addcomment.cfm page.
>
> <cfif NOT listContainsNoCase(CGI.HTTP_REFERER, 'articles.cfm') AND  
> (NOT
> isDefined("FORM.submit"))>
>  <cflocation url="index.cfm" addtoken="no">
> </cfif>
>
> i think i first may try the session variable set on the articles  
> page, and check for this on the addcomment page.
>
> cheers.
>
> mike
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293443
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to