[982]PHP網站開發 進階應用技巧
<?php
session_start();
$txt=rand(10000,99999);
$_SESSION['key']=$txt;
header("Content-type: image/gif");
$im = @imagecreatefromgif("bbn022.gif") or die("無法建立GD圖片");
$text_color = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, 35, 0 , 150, 43, $text_color,"Hancock.TTF",$txt);
imagegif($im);
imagedestroy($im);
?>