khendar wrote:
Sending form must send a returning url variable. If it does not, the script shows a general error. This is intended to prevent cross site scripting hacks.
I'm not sure I understand this one. A robot will follow a link on some other page, therefore it will supply the same query string as a browser.
[*]HTTP_REFERER must be in an allowed array which I maintain. If HTTP_REFERER is null or is not contained in this array, an error is returned.
This will give false positives. Many legitimate users will send no HTTP_REFERER.
[*]Email address must be syntactically valid, otherwise an error is returned.\
Reasonable practice, but it won't stop any spammers. All spam bots always populate every email field with a random syntactically valid email address.
[*]REMOTE_ADDR is checked against a blacklist of known spammer IPs. If the REMOTE_ADDR is in the list, an error is returned
Won't stop a lot of spammers. Most use zombie networks and/or open proxies. Might stop a few lamers.
[*]All fields are checked for spam keywords against a list of common spam words. If any spam words are found, the IP is added to the blacklist and an error is returned.
Sounds like a reasonable idea. How long do you blacklist them for?
[*]finally, the recipient address is hard coded so emails come to me and me only.
[/LIST]
Be sure that the subject and/or other fields are not suceptible to header injection.
[quote
I have considered adding a hash key system to the script, would this be overkill ?[/QUOTE]
I don't know what you mean.
Mark