Вход Регистрация
Файл: regimg.php
Строк: 24
<?php
$code 
= '';
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$fo = @fopen('regcodeimg.reg', 'w+');
@
fputs($fo, $code);
@
fclose($fo);
$img = @ImageCreate(50, 20);
$color1 = @ImageColorAllocate($img, 255, 255, 255);
$color2 = imagecolorallocate($img,rand(0,204),rand(0,204),rand(0,204));
@
ImageFilledRectangle($img, 0, 0, 50, 20, $color1);
@
ImageString($img, 5, 7, 2, $code, $color2);
for (
$i=0; $i<5; $i++){
            
$temp_color=imagecolorallocate($img,rand(0,204),rand(0,204),rand(0,204));
            
$pos=array(rand(0,42),rand(0,18),rand(0,42),rand(0,18));
            
imageline($img,$pos[0],$pos[1],$pos[2],$pos[3],$temp_color);
            }
Header("Cache-Control: no-cache");
Header("Content-type: image/png");
ImageGIF($img);
ImageDestroy($img);
?>
Онлайн: 2
Реклама