Web Hosting Talk







View Full Version : disguising email addresses in PHP and still create valid mailto links?


tonomud
06-30-2008, 10:31 AM
I work on a website that generates a bunch of profile pages with PHP pulling the data from a mysql database.

The profiles include email address, currently just pulled plain vanilla from the database as straight mailto links. In an effort to try and reduce spam, I'd like to find a way that I can obfuscate the links using PHP or Javascript or something. I've used Enkoder [hivelogic.com] to do this on a limited basis with a few emails on some other sites, but there are a ton more addresses on this site which would preclude me from manually processing each address by hand and then updating the database.

Anybody have a good way of doing this, preferrably with a little dynamically generated javascript or php?

thanks

Syd_M
06-30-2008, 11:00 AM
This (http://www.celticproductions.net/articles/10/email/php+email+obfuscator.html) might help. :)

hostingstud
07-01-2008, 10:25 PM
you can have simple redirection in php.

You can have a sitename.com/page.php?id=anyencodedemailaddress

and then on the page.php you can check the encoded email address you can decode the email id and then redirect it to the email address.