>I have a newsletter form on my website that accepts frist name, last
>name and email. The sorry spam crawlers are submitting bogus
>information into the form. Most of the time, they are sending the
>first name and last name in both name fields so that I recieve
>something like this:
>
>You have a new subscriber to your e-newsletter:
>
>First Name: David Boswell
>Last Name: David Boswell
>Email Address: [EMAIL PROTECTED]
>
>How can I make it so that each name field only accepts one word with no spaces?
>
>I made several attempts at this using cfform and regular expressions
>but I'm not very good with regular expressions so I couldn't figure it
>out.
>
>Thanks for the help,
>Aaron

Hi Aaron,

Not sure whether you've solved this but here's another idea.. Invoke a web 
service and pass it your #form.email# value.  Then check the response back as 
to whether the email is valid or not.

<Cfoutput>
<cftry>
 <cfinvoke webservice="http://www.webservicex.com/ValidateEmail.asmx?WSDL"; 
method="IsValidEmail" returnvariable="emailResponse">
        <cfinvokeargument name="email" value="#form.email#" />
</cfinvoke> 
<cfcatch type="any">
</cfcatch>
</cftry>
<!--- #emailResponse# returns either "YES" or "NO"--->
</Cfoutput>

<cfif #email EQ "YES">
   then proceed
<cfelse>
   don't proceed
</cfif>

Scott

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265520
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