// description of your code here
<?php
if(empty($_GET['sid'])){
//write html for image
$mail='example@domain.com';
$text=base64_encode(serialize($mail));
echo '<img src="imgmail.php?sid='.$text.'" /><br/>';
}else{
//show coded mail image
$text=$_GET['sid'];
header("Content-type: image/gif");
echo mail_to_image($text);
}
function mail_to_image($ctext='no mail'){
$text=unserialize(base64_decode($ctext));
$size=strlen($text)*8;
$im = @imagecreate($size, 20) or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im,3, 5, 5, $text , $text_color);
return imagegif($im);
}
?>