CodeIgniter Forums

Full Version: safe mailto
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]vertmonkee[/eluser]
I've just been looking at the safe_mailto function which outputs the address through javascript to hide it from spam bots.

If the user does not have javascript enabled no email address is displayed. So I've put the plain text version of the email after in a noscript tag like so

Code:
Email: &lt;?php echo safe_mailto('[email protected]', '[email protected]'); ?&gt;<noscript>'[email protected]'</noscript>

My question is, by doing this do will spam bots stil pick up on the email address or do they tend to just look for a <a href="mailto"> link?

I know you can never completley protect against spam, just wondering if it worth me bothering with this technique.

Thanks

El Forum

[eluser]AJR[/eluser]
I'm certainly no expert but having the email address in the <noscript> tags is just as bad. Spam bots will likely run a regex on the code to extract all email addresses, not just those in an anchor tag.

There are some methods such as obsfucation which will make the spam bots work harder. http://www.zapyon.de/spam-me-not/index.html

El Forum

[eluser]vertmonkee[/eluser]
Thanks for the reply. I did think it wasn't going to help.

I think it might be best to just stick to the regular mailto and then have our spam filters sort out the incoming emails.

Cheers

El Forum

[eluser]Rob Gordijn[/eluser]
why not checking if the visitor has javascript enabled?
If not, ask the visitor to enable it, problem solved :-)

.o/

El Forum

[eluser]vertmonkee[/eluser]
A nice idea but I work for an academic institue so we can't really add restrictions like that.