Thursday, March 5, 2009

Weekly Source Code: PHP - Email Address Images

Sorry ladies & gents that there wasn't a weekly source code last week, work was crazy.

On which is one of the websites I'm working on, you will notice that the email address for an accommodation is actually an image and that there is in the HTML no "mailto:" tag. This is one way to prevent spammers from grabbing your email address from a website by converting the email address to an image and then use my No SPAM email link functionality (that I must still port over from .Net to PHP)

Here's the code that create the image

the email address get stored in $emailAddressEntity, for example ""
@imagecreate is the PHP method that create the image.

After this you can refer to the image



No comments: