Вход Регистрация
* -=(C)DRU987=- (Dev)

Надежная captcha

  1. $md5_hash = md5(rand(0,99999));
  2. $security_code = substr($md5_hash, 25, 5);
  3. $enc = md5($security_code);
  4. $_SESSION['captcha'] = $enc;
  5.  
  6. $width = 150;
  7. $height = 30;
  8.  
  9. $image = ImageCreate($width, $height);
  10. $white = ImageColorAllocate($image, 255, 255, 255);
  11. $black = ImageColorAllocate($image, 0, 0, 0);
  12. $grey = ImageColorAllocate($image, 200, 200, 200);
  13.  
  14. ImageFill($image, 0, 0, $white);
  15. ImageString($image, 10, 5, 0, $security_code, $black);
  16.  
  17. header("Content-Type: image/png");
  18. ImagePng($image);
  19. ImageDestroy($image);
» Описание: Надежная и в то же время простая captcha на php
» Время добавления: 2 Июня 2014 в 10:52
» Посмотров: 1206
» textarea
» Рейтинг: [+1 | -0]
Комментарии [0]
Онлайн: 2
Реклама