<?php
session_start(); 

//create random text for captcha
$text = substr(str_shuffle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 6);

//create image
$image = imagecreate(232, 30);

//set background color
$background_color = imagecolorallocate($image, 153, 187, 232);

//set text color
$text_color = imagecolorallocate($image, 0, 0, 0);

// Load the gd font
//$font = imageloadfont('./04b.gdf');
$font=5;

//write text on image
imagestring($image, $font, 100, 7, $text, $text_color);

//set content type
header('Content-type: image/jpeg');

//output image
imagejpeg($image);

//free memory
imagedestroy($image);
//store text in session for comparison during form submission
//$_SESSION['developer']="falguni";
echo $_SESSION['6_letters_captcha'] = $text;
?>