You are here: Re: Form spam? What to do? « HTML « IT news, forums, messages
Re: Form spam? What to do?

Posted by cwdjrxyz@yahoo.com on 09/10/05 01:48

chlori wrote:
> Good morning
>
> Some of my customers are complaining that someone/something
> is spamming the contact forms on their sites in the last weeks.
>
> In the E-Mail field there is a random e-mail address with
> the domainname of the site. So it's difficult to use a junk
> filter on the mailserver, isn't it?
>
> In the comments field, the same e-mail address is repeated.
> Nothing else. It's not always the same address.
>
> These mails come at any day or night time, so if it's the
> same person, he doesn't sleep much...
>
> My questions:
> What's happening? Is that a person? Software? Why are they
> doing that? Doesn't seem to help anyone...
>
> What's the best way to stop getting those mails without
> making it a too big fight filling in the form?
>
> Thanks for your ideas!
>
> --
> chlori

You might consider php to help. Since a client can not turn off php on
your server, you can use php scripts without losing visitors that have
javascript turned off.

Just to indicate a possible direction, I have a perpetual calendar page
where the user must first enter a desired year in a form. I want to
validate the year so only a whole number from 1 to 60000 inclusive will
be accepted. This page is quite long and done mostly in php script, so
I have extracted the essentials so that it is more easy to see what I
am doing. To see the php script in action, see
http://www.cwdjr.net/calendar2/numbercheck.php . Enter both bad and
good characters. You will notice there is a 5 second delay after bad
inputs. This is to slow down people or bots who are guessing, and the
sleep command can be changed to any number of seconds desired. There is
no delay for a correct entry. To see the php code used, you will have
to view a text file at http://www.cwdjr.net/calendar2/numbercheck.txt .
Please note that IE6 has a bug in viewing many text files that include
php code, and you will have to right click and select view source to
see the code on IE6. Other recent common browsers do not have this
problem.

You will notice a php include at the top of the code. This include file
may be seen at http://www.cwdjr.net/calendar2/mime.txt . I am now
serving many new pages in true xhtml 1.1 using the correct mime type of
application/xhtml+xml for the extension .xhtml on the server. What the
include code does is to detect if the viewing browser will accept the
mentioned mime type. If it will, everything above the title tag of the
page is written as xhtml 1.1 and correctly served as such. If it is
detected that an outmoded browser, such as IE6, can not handle the
mentioned mime type, then the php code writes everything above the
title tag as html 4.01 strict. In addition, a regular expression is
used to change self closed tags such as <br /> to <br> required for
html 4.01 strict. I have added an alert to pop up if a browser that
will not support application/xhtml+xml is detected and the viewer has
script turned on. This is my protest of the lack of standards
compliance of IE6, which is the main current browser that will not
support true xhtml 1.1. How to remove this alert is shown in the source
code, as you would not want this on a commercial site that wants to
sell something.

My example is just something to get you started. If you need to exclude
certain characters or groups of characters, regular expressions, as
used in the php include file, are a powerful way to do this.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация