mail.php代码
/*
MailX Managment System 0.8 Beta
*/
header("Content-type:image/png");
$mailaddress=$_GET['mailname'];
$mailaddresslen=strlen($mailaddress);
$mailaddressimages=imagecreate($mailaddresslen*10,25);
$lenadd=$mailaddresslen;
$fontsize="4";
$center=(imagesx($mailaddressimages)-8.3*strlen($mailaddress))/2;
$mailimagesbackground=ImageColorAllocate($mailaddressimages,255,255,255);
$mailimagesfacecolor=ImageColorAllocate($mailaddressimages,0,0,0);
ImageString($mailaddressimages,$fontsize,$center,5,$mailaddress,$mailimagesfacecolor);
Imagepng($mailaddressimages);
ImageDestroy($mailaddressimages);
?>
255,255,255 生成图片的背景颜色(RGB哦)
$fontsize="4";字体大小
( $mailaddresslen*10,25); $mailaddresslen*10表示:生成图片宽:Email地址字符个数*10,25表示高
以上保存为mail.php 然后访问mail.php?mailname=you@domain.com,就可以输出mailname=后面的邮件地址了.
当然,如果你嫌麻烦,可以用一个表单来代替.如下:
index.html代码如下:
Welcome to domain.com