View file guest/image.php
<?php session_start(); $code =rand(111,999); $_SESSION['code']=$code; $im=imageCreateFromPNG("code.png"); $Color = imageColorAllocate($im, 000, 000, 000); settype ($code, "string"); imageString($im, 7, 15, 3,$code, $Color); Header("Content-type: image/png"); imagegif($im,"",100); imageDestroy($im); ?>