Blame view

spam/index.php 1.07 KB
42868d70   andryeyev   Создал GIT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  <?php
  session_start();
  header('Content-Type: image/png');
  $img = imagecreate(110,30);
  $colorGrey=imagecolorallocate($img, 190, 190, 190);
  $black = imagecolorallocate($img,0,0,0);
  $white = imagecolorallocate($img,255,255,255);
  imagerectangle($img,2,2,13,60,$colorGrey);
  imagefill($img,0,0,$white);
  $n[] = rand(0,9);
  $n[] = rand(0,9);
  $n[] = rand(0,9);
  $n[] = rand(0,9);
  $_SESSION['spam'] = implode('',$n);
  imagettftext($img,20,0,9,25,$black,'timeset.ttf',implode(' ',$n));
  //imageline($img, 0, 0, 0, 150, $black);
  //imageline($img, 0, 0, 150, 0, $black);
  //imageline($img, 60, 60, 60, 60, $black);
  $p = 0;
  while ($p<800)
  {
     $x = mt_rand(1,109); // ńëó÷ŕéíŕ˙ ęîîđäčíŕňŕ ďčęńĺë˙ řóěŕ ďî îńč X
     $y = mt_rand(1,29); // îńü Y   imagecolorat($im, 10, 15);
     $pixel = imagecolorat($img, $x, $y); // óçíŕĺě ęŕęîé öâĺň čńďîëüçóĺňń˙ íŕ ěĺńňĺ áóäóůĺăî ďčęńĺë˙ řóěŕ
     $point = ($pixel == $colorGrey) ? $white : $colorGrey; // ĺńëč áűë ÷ĺđíűé, ęđŕńčě ďčęńĺëü áĺëűě, ĺńëč áĺëűé - ęđŕńčě ÷ĺđíűě
     imagesetpixel($img,$x,$y,$point); // đčńóĺě ńŕě ďčęńĺëü
     $p++;
  }
  imagepng($img);
  imagedestroy($img);
  ?>