Re: protecting email addresses on a web site

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 16, 2010 at 16:29, ash@xxxxxxxxxxxxxxxxxxxx
<ash@xxxxxxxxxxxxxxxxxxxx> wrote:
> Sorry for top post on phone.
>
> Depending on the type of site and location an email address might be legally required. For example, a business website in the UK requires a value email address to be made accessible to all your visitors, which includes blind people, so no image-only addresses.
>
> Spam is just a fact of life now, and the only real method of protection is a decent spam filter.


<?php

/**
 * Just hacked this together for your usage now.  It's
 * a very basic implementation of a graphical display
 * of an email address (or any text, for that matter).
 * This can still easily be picked up by harvesters that
 * employ OCR, but beggars cannot be choosers.  Well,
 * they can, but they really shouldn't.  I mean, seriously,
 * there they are, just hoping and praying for a handout,
 * and when it finally comes, they bitch and moan that
 * I don't have any apples that didn't fall into the
 * sewer and sit there for a week that one time I donated
 * food to the food kitchen because I wanted this girl
 * to like me but it turned out she was a lesbian so
 * I just wasted the gas in the first place and my
 * car smelled like homeless people and crap-flavored
 * apples for three weeks.
 */
function drawEmail($email) {

	/**
	 * Set the width/height of the image.
	 */
	$im = imagecreate(220,20);

	/**
	 * Define the colors to be used, using RGB values.
	 */
	$black = imagecolorallocate($im,0,0,0);
	$white = imagecolorallocate($im,255,255,255);

	/**
	 * Fill the image with a chosen color.
	 */
	imagefill($im,0,0,$white);

	/**
	 * Calculate the text size to be used.
	 */
	$px = (((imagesx($im) - 7.5) * strlen($string)) / 2);

	/**
	 * Write $email in calculated size with chosen color.
	 */
	imagestring($im,3,$px,9,$email,$black);

	/**
	 * Output the image.
	 */
	header("Content-type: image/png");
	imagepng($im);

	/**
	 * Garbage clean-up, pass-through the status bool.
	 */
	return imagedestroy($im);
}

drawEmail('danbrown@xxxxxxx');

?>


-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux