Technology TidBits

Answers to various technical questions on php programming, mysql, linux, and many more categories.
25% off Hosting at HostGator.com:
Use Code techbits25



Here's a simple captcha method for ASP:

Last updated: 06/16/2009

Stopping form spam is a big issue these days.  If you want to avoid using fuzzy images that your users can't read, try something simple like this:

 On your form, create a field called "dow" - and ask the user to enter the current day of the week. (Sunday, Monday, etc.).  On the back end, put this in your code:

' Check dow
if(LCASE(request("dow")) <> LCASE(WeekDayName(WeekDay(Now())))) Then
%><script>alert('Please enter the correct day of the week!');
history.go(-1);
</script>
<%
Response.End
End If

This isn't foolproof, but will stop most dummy spam robots. The biggest potential problem is that your customer might not know how to spell the day name, or someone might submit at midnight and not realize the day changed over. Anyway, it's an easy tool to reduce / stop form spam, which doesn't annoy your customers.

blog comments powered by Disqus
Have your own Tech-bit to contribute? Submit it here

Other questions in this category:
I get this error runing asp scripts - Disallowed Parent Path. How can I fix this?
My asp scripts give me an Error 500 with no useful debugging information. How can I fix this?
What's this error mean: ActiveX component can't create object: 'EasyMail.SMTP' ?
My asp conditional statements are not working - what's going on?
I'm getting an error "ASP_0131 Disallowed_Parent_Path" trying to include an asp page



Powered by KnowledgebasePublisher 1.1
Host Gator
Content provided by Roberts WebForge, Inc.