<?
        
        
        
        
        
          session_start();
          
          header("Content-Type: image/png");
          
$chars = 'abdefhknrstyz23456789';
$numChars = strlen($chars);

          $_SESSION['control'] = substr($chars, rand(1, $numChars) -6, 5);
          
          $code = $_SESSION['control'];
          
          $img=imagecreatetruecolor(60, 30);
          
          $x1=0;
          
          $x2=60;

          $x3=40;
          
          $y1=rand(0, 30);
          
          $y2=rand(0, 30);

          $y3=rand(0, 30);

          imagefill($img, 0, 0, 0xf6f6f6);
          
          $textcolor = imagecolorallocate ($img, 22, 62, 55);
          
          imageline($img, $x1, $y1, $x2, $y2, $textcolor);
       
          
          $x1=rand(0, 50);
          
          $x3=rand(0, 50);
          
          $x3=rand(0, 50);
          
          $y1=0;
          
          $y2=30;

          $y3=60;
          
  imageline($img, $x1, $y1, $x2, $y2, $textcolor);
       
          
          
          imagestring($img, 4, 12, 3, $code, $textcolor);
          
          imagepng($img);
          
          imagedestroy($img);          







?>