«
PHP实例:email address 生成图片程序

时间:2008-5-31    作者:Deri    分类: 分享


   <p>  把下面的文件保存为index.php</p><code><?<br />/*<br />MailX Managment System 0.8 Beta<br />*/<br />header("Content-type:image/png");<br />$mailaddress=$_GET['mailname'];<br />$mailaddresslen=strlen($mailaddress);<br />$mailaddressimages=imagecreate($mailaddresslen*10,25);<br />$lenadd=$mailaddresslen;<br />$fontsize="4";<br />$center=(imagesx($mailaddressimages)-8.3*strlen($mailaddress))/2;<br />$mailimagesbackground=ImageColorAllocate($mailaddressimages,231,196,43);<br />$mailimagesfacecolor=ImageColorAllocate($mailaddressimages,0,0,0);<br />ImageString($mailaddressimages,$fontsize,$center,5,$mailaddress,$mailimagesfacecolor);<br />Imagepng($mailaddressimages); <br />ImageDestroy($mailaddressimages);<br />?></code>把下面的文件保存为index.html</p><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml" /><br /><head><br /><title>Welcome to domain.com</title><br /><meta content="all" name="robots" /><br /><meta content="webmaster@domain.com,US" name="author" /><br /><meta content="www.domain.com,Reprint from then webseits" name=Copyright /><br /><meta content="Welcome to domain.com!" name=description /><br /><meta content="About For China News Sports Entertainment Shop Business Travel" name=keywords /><br /><meta http-equiv=Content-Language content="iso-8859-1" /><br /><link rev=stylesheet media=all href="css/style01.css" type=text/css rel=stylesheet /><br /><style type=text/css media=all>@import url("css/style01.css");</style><br /><meta http-equiv="Content-Language" content="en" /><br /><meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" l gen true for "http://www.domain.com" r (nz 1 vz 1 lz 1 oz 1 cz 1) gen true for "http://www.domain.com" r (nz 1 vz 1 lz 1 oz 1 cz 1))' /><br /><meta http-equiv="reply-to" content="webmaster@domain.com" /><br /><meta name="Author" content="domain.com employee" /><br /><meta name="Copyright" content="Copyright (C) 2002-2005 domain.com All signature Rights Reserved." /><br /><meta content="MSHTML 6.00.3790.0" name="generator" /><br /></head><br /><body><br /><form action="index.php" mothod="post"><br />You email:<input name="mailname" type="text" value="Webmaster@domain.com" /><br /><input type="submit" value="确定" /><br /></form></code><p>  然后把两个文件放在同一个目录就可以了.</p><p>  这个程序主要是.</p><p>  通过get获取值后生成.一个图片格式的email地址.</p><p>  主要是为了防止email搜索软件抓取email地址.</p>