<?php
// echo '<img src="XXX.php">';
$Validatemun=$_SESSION['ValidateNumber'];
if( ereg("^[0-9]{3,4}$",$Validatemun) ) // 控制字次3-4位数
{
Header("Content-type:image/png");
$img = imagecreate( 40, 17 );
$BlackColor = ImageColorAllocate ( $img, 255, 255, 255 );
$FontColor = ImageColorAllocate ( $img, rand(0,100), rand(0,100), rand(0,100) );
imageline ( $img, 1, 1, 350, 25, $BlackColor );
imagestring ( $img, 5, 2, 1, $Validatemun, $FontColor);
for( $i=0; $i<300; $i++ ) // In the Interference pt.
{
$randcolor = ImageColorallocate( $img, rand(0,255), rand(0,255), rand(0,255) );
imagesetpixel ( $img, rand()%70, rand()%30, $randcolor );
}
ImagePng( $img );
ImageDestroy( $img );
}
?>
|