Location: PHPKode > projects > Itshomi PHP Framework > itshomi/secimg.php
<?php
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$code = $_SESSION['secCode'];
$im = @imagecreate(128, 25) or die("Cannot Initialize new GD image stream");
$bc = imagecolorallocate($im, 255, 0xcc, 0xcc);
$tc = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 7, 4, 4,  $code, $tc);
srand((double)microtime()*1000000);
$degrees = rand(1,15);
$rotate = imagerotate($im, $degrees, 0);
Header ('Content-type: image/png');
imagepng($rotate);
imagedestroy($im);
imagedestroy($rotate);
Return current item: Itshomi PHP Framework