File size: 1.08Kb
<?
session_start();
$_SESSION['cod']=rand(10000,9999999);
$_SESSION['cod'] = intval($_SESSION['cod']);
if ($_GET['v']=="xhtml") // xHTML
{
$pswd_arr=str_split($_SESSION['cod']); // заносим в массив
list(, , $type,)=@getimagesize("zxhtml.jpg");
if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";}
if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";}
$im1 = @$funci("zxhtml.jpg");
$x=1;
for ($i=0;$i<=count($pswd_arr)-1;$i++)
{
$y=rand(-2,10);
$R=rand(0,180);
$G=rand(0,180);
$B=rand(0,180);
$black = ImagecolorAllocate($im1,$R,$G,$B);
ImageString ($im1, 5, $x, $y, $pswd_arr[$i],$black);
$x=$x+rand(9,13);
}
}
elseif($_GET['v']=="wml") // WML
{
list(, , $type,)=@getimagesize("zwml.jpg");
if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";}
if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";}
$im1 = @$funci("zwml.jpg");
$black = ImagecolorAllocate($im1,255,255,255);
ImageString ($im1, 2, 1, -2,"".$_SESSION['cod']."",$black);
}
@header("Content-type: image/png");
@imagepng($im1);
?>