<?php
	session_start();
	$value = $_SESSION['checkRegisterValue'];
	//if (!isset(value)) exit;
	
	$s1 = floor($value/1000);
	$s2 = floor(($value - $s1*1000)/100);
	$s3 = floor(($value - $s1*1000 - $s2*100)/10);
	$s4 = $value - $s1*1000 - $s2*100 - $s3*10;

	header('Content-type: image/png');
	$im = @imagecreate (100, 30) or die ("Impossible d'initialiser la librairie GD");
	$background_color = imagecolorallocate ($im, 155,110,75);
	$text_color = imagecolorallocate ($im, 0, 0, 0);
	imagestring ($im, rand(0,5), 5, 5,  $s1, $text_color);
	imagestring ($im, rand(0,5), 25, 5,  $s2, $text_color);
	imagestring ($im, rand(0,5), 45, 5,  $s3, $text_color);
	imagestring ($im, rand(0,5), 65, 5,  $s4, $text_color);
	imagepng ($im);


/*
header("Content-type: image/png");
$string = $_GET['text'];
$im    = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px    = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);

  header ("Content-type: image/png");
  $im = @imagecreate (50, 100)
    or die ("Impossible d'initialiser la librairie GD");
  $background_color = imagecolorallocate ($im, 255, 255, 255);
  $text_color = imagecolorallocate ($im, 233, 14, 91);
  imagestring ($im, 1, 5, 5,  "A Simple Text String", $text_color); 
  imagepng ($im);
*/

?>
