当前位置:网站首页 > 教程 > 帝国cms教程 > 帝国CMS手机号码生成图片格式

帝国CMS手机号码生成图片格式

蓝色枫叶 蓝色枫叶 2020-05-25 前往当前专题: 帝国cms教程

使用方法 文件地址/phone.php?phone=手机号码
调用方法。在模板中用  例如phone.php在根目录

<img src="/phone.php?phone=[!---手机号码字段--]" width="140" height="30" />

如果参数需要加密。可以在模板调用的时候先用base64_encode进行加密。
/*

加密方式:

base64_encode -- 使用 MIME base64 对数据进行编码

列表页
$listtemp='
     <img src="/phone.php?phone='.base64_encode($r[字段名称]).'" width="140" height="30" />
';

---------------------------------------


内容页:

<img src="/phone.php?phone='.base64_encode($navinfor[字段名称]).'" width="140" height="30" />


*/




在phone.php中解密输出即可。


/*

解密

$phone= base64_decode($get['phone']);



*/



******* 另外 ******

字体库可以找自己喜欢的替换~

--------------------------------------------------

不想下载的可以直接复制代码

<?php
$get=$_GET;$phone=$get['phone'];
$im = @imagecreatetruecolor(130, 30);
$bgcolor = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im,0,0,130,30,$bgcolor);
$fontcolor = imagecolorallocate($im,255,0,0);
$fonttype='lsansi.ttf';
$text=$phone;
imagefttext($im,13,0,3,19,$fontcolor,$fonttype,$text);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>

phone可以改成你合适的。例如QQ、age、等等

蓝色枫叶

蓝色枫叶

TA很懒,啥都没写...

Copyright 蓝色枫叶 www.lansefengye Rights Reserved.