<?
session_start();
$number = rand(1,9).rand(1,9).rand(1,9).rand(1,9).rand(1,9).rand(1,9);
$_SESSION['security'] = $number;
header("Content-type: image/jpeg");
header("Content-type: image/jpeg");
$im = imagecreatefromjpeg("back.jpg");
$black = imagecolorallocate($im, 100, 100, 100);
imagestring($im, 10, 20, 1, $_SESSION['security'], $black);
imagejpeg($im);
imagedestroy($im);
?>
Published in: PHP
Download

Related snippets