Don’t you just hate it it when your website has a contact form and all you receive is email after email of advertising, porn web links and Viagra? Well I do anyway. While there are ways for your email client to filter the spam, there are ways to help dramatically reduce the spam sent through your contact form.
The problem
The problem is that automated scripts / users fill out forms advertising information which is considered garbage. While to us we do not take any notice but for them a link helps improve their site in search results or make money and even some cases spread viruses. It is a major problem that is not going away anytime soon.
The solution
The standard solution
Server side validation using a regular expression or validation routine checks for valid emails and to apply strict rules in the inquiry area. For example not allowing emails, web addresses. This depends on what information you are gathering from the form. This can be programmed in such languages such as ASP and PHP. This is basic practice but in conjunction with other methods this can be improved.
The client side
Probably the poorest form of validation is client side. This is mainly for the user using the form. Based on JavaScript this can easy be turned off by the user and automated scripts can easy bypass this method. This should be used in conjunction with server side validation and never use this on its own.
Advanced spam checks
continue reading…