corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
<?php // ۞// text{ encoding:utf-8; bom:no; linebreaks:unix; tabs:4; }
$secure_email_img['version'] = '0.1';
/*
simple secure email image
displays your email address as an image, which should prevent
harvesters from stealing it, and feeding it spam.
To use:
simply insert this as an image wherever you would put your email
address, e.g..
Send me an email, here: <img src="/path/to/this-script.php" alt="my addy" style="vertical-align:bottom;border;0"/>
;o)
*/
// prefs..
//
$secure_email_img['address'] = 'zroc@corz.org';
// text size
// 1-5
$secure_email_img['text_size'] = 5;
// border around the text. in pixels..
//
$secure_email_img['border'] = 1;
// background color..
$secure_email_img['background'] = '#fff7d1';
// text color..
$secure_email_img['text_color'] = '000000';
//
// end prefs.
// okay, let's go..
//
// transform user preferences..
//
$secure_email_img['background'] = hex2dec($secure_email_img['background']);
$secure_email_img['text_color'] = hex2dec($secure_email_img['text_color']);
$secure_email_img['img_width'] = (imagefontwidth($secure_email_img['text_size']) * strlen($secure_email_img['address']))
+ ($secure_email_img['border'] * 2);
$secure_email_img['img_height'] = imagefontheight ($secure_email_img['text_size']) + ($secure_email_img['border'] * 2);
// open image and lay email text on it..
$secure_email_img['img'] = imagecreate($secure_email_img['img_width'], $secure_email_img['img_height'] );
$secure_email_img['bg'] = imagecolorallocate($secure_email_img['img'], $secure_email_img['background'][0], $secure_email_img['background'][1], $secure_email_img['background'][2]); // email_img['bg']
$secure_email_img['txtcol'] = imagecolorallocate($secure_email_img['img'], $secure_email_img['text_color'][0], $secure_email_img['text_color'][1], $secure_email_img['text_color'][2]); // email_img['bg']
imagestring($secure_email_img['img'], $secure_email_img['text_size'], $secure_email_img['border'],
$secure_email_img['border'], $secure_email_img['address'], $secure_email_img['txtcol']);
// send the image
header("Content-type: image/jpeg");
imagejpeg($secure_email_img['img']);
imagedestroy($secure_email_img['img']);
/*
function hex2dec()
convert an HTML #hex colour to decimal colour levels.. */
function hex2dec($rgb) {
if (substr($rgb, 0, 1) == "#") {
$rgb = substr($rgb, 1);
}
$r = hexdec(substr($rgb, 0, 2));
$g = hexdec(substr($rgb, 2, 2));
$b = hexdec(substr($rgb, 4, 2));
return array($r, $g, $b);
}/*
end function hex2dec() */
?>