Re: Re: Hiding email address from Robots ??
| From: | Ben Ramsey | Date: | Thu, 08 Apr 2004 21:57:50 +0000 |
| Subject: | Re: Re: Hiding email address from Robots ?? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182920@lists.php.net to get a copy of this message | ||
CZ> It all depends on the persons dedication on finding them.
I usually just convert them to HTML entities with a function like this:
function spamProtect ($address) {
$address = str_replace("@", "@", $address);
$address = str_replace(".", ".", $address);
$address = str_replace(":", ":", $address);
return $address;
}
You can call it with:
spamProtect("me@example.com")
or
spamProtect("mailto:me@example.com")
But, like Curt said, those dedicated to harvesting e-mail addresses can add further complexity to their e-mail harvesting programs and catch these rather easily.
Ultimately, the best way to keep people from grabbing e-mail addresses is not to display them on your Web site at all. This hurts you if you need a point of contact; however, you could use a form that sends a message to a processing script that then e-mails the message to the intended recipient. The e-mail address would never need to be visible to the browser, and so, the harvesters would never get your address.
--
Regards,
Ben Ramsey
http://benramsey.com
http://www.phpcommunity.org/wiki/People/BenRamsey