<?php
session_start();
//if($_GET["act"]  ==  "water")
{
	header ("Content-type: image/png");
	$_SESSION['login_check_number'] = strtoupper(substr(md5(rand()),20,4));
//	session_register("login_check_number"); 
	$im = @imagecreate (80, 20)
    	or die ("Cannot Initialize new GD image stream");
	$background_color = imagecolorallocate ($im, 200, 200, 200);

	//..........OCR
	for ($i=0;$i<=128;$i++)
	{
		$point_color = imagecolorallocate ($im, rand(0,255), rand(0,255), rand(0,255));
		imagesetpixel($im,rand(2,128),rand(2,38),$point_color);
	}

	//.........
	for ($i=0;$i<=5;$i++)
	{
		$text_color = imagecolorallocate ($im, rand(0,255), rand(0,128), rand(0,255));
		$x = 5 + $i * 20;
		$y = rand(1,5);
		imagechar ($im, 5, $x, $y, $_SESSION['login_check_number']{$i}, $text_color);
	}


	//..PNG..
	imagepng ($im);
	imagedestroy ($im);
	die();                                                   
	}
?> 

