<?php
$random = rand(0, 100000); //If this were a security code confirmation this would be grabbed from mysql
$im = @imagecreate (100, 100) or die ("Failed to make new image");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0, 0, 0);
imagestring ($im, 4, 5, 5, $random, $text_color);
imagejpeg($im, "path to directory/temp.jpg");
echo "<IMG SRC=\"temp.jpg\">\n";
?>