<?php
session_start();
$rand = rand(100000,999999);
$_SESSION['checkcod'] = $rand;
$im = imagecreate(45, 15);
$background_color = imagecolorallocate($im, 255, 255, 255);
$col = ImageColorAllocate($im,255,0,0);
ImageString($im,3,2,1,$rand,$col);
header('Content-Type: image/gif');
header('Cache-control: no-cache, no-store');
imagegif($im);
imagedestroy($im);
?>