帝國CMS手機號碼生成圖片格式
發布時間:2019-10-24 來源:未知 瀏覽: 關鍵詞:
使用方法 文件地址/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、等等
責任編輯:實速科技