首页 > 开发 > PHP > 正文

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

2024-05-04 23:03:52
字体:
来源:转载
供稿:网友

把下面的文件保存为index.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,231,196,43);
$mailimagesfacecolor=imagecolorallocate($mailaddressimages,0,0,0);
imagestring($mailaddressimages,$fontsize,$center,5,$mailaddress,$mailimagesfacecolor);
imagepng($mailaddressimages); 
imagedestroy($mailaddressimages);
?>


把下面的文件保存为index.html

<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3c.org/tr/1999/rec-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" />
<head>
<title>welcome to domain.com</title>
<meta content="all" name="robots" />
<meta content="[email protected],us" name="author" />
<meta content="www.domain.com,reprint from then webseits" name=copyright />
<meta content="welcome to domain.com!" name=description />
<meta content="about for china news sports entertainment shop business travel" name=keywords />
<meta http-equiv=content-language content="iso-8859-1" />
<link rev=stylesheet media=all href="css/style01.css" type=text/css rel=stylesheet />
<style type=text/css media=all>@import url("css/style01.css");</style>
<meta http-equiv="content-language" content="en" />
<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))' />
<meta http-equiv="reply-to" content="[email protected]" />
<meta name="author" content="domain.com employee" />
<meta name="copyright" content="copyright (c) 2002-2005 domain.com all signature rights reserved." />
<meta content="mshtml 6.00.3790.0" name="generator" />
</head>
<body>
<form action="index.php" mothod="post">
you email:<input name="mailname" type="text" value="[email protected]" /><br /><input type="submit" value="确定" />
</form>

然后把两个文件放在同一个目录就可以了.

这个程序主要是.
通过get获取值后生成.
一个图片格式的email地址.
主要是为了防止email搜索软件抓取email地址.



收集最实用的网页特效代码!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表