Просмотр файла captcha.php

Размер файла: 720B
  1. <?php
  2. include "header/config.inc.php";
  3. include "header/function.inc.php";
  4. include "header/connect.inc.php";
  5. include "header/click-club.class.php";
  6.  
  7. @mysql_query("DELETE FROM `".prefix."captcha` WHERE (`ip`='".ip."' && `ua`='".short_agent."') OR `ts`<".(time()-captchado));
  8. $ctext=$click_club->captcha_text(lenght_code);
  9. $result=@mysql_query("INSERT into `".prefix."captcha`
  10. (`ip`,`ua`,`ts`,`code`)
  11. values
  12. ('".ip."','".short_agent."','".time()."','".$ctext."')
  13. ");
  14. If (!$result) exit;
  15.  
  16. $image=imageCreateFromPng("captcha.png");
  17. $colour=imageColorAllocate($image,0,0,0);
  18. imageTTFText($image,20,0,2,25,$colour,getcwd()."/click-club.ttf",$ctext);
  19. header("Content-type: image/png");
  20. imagepng($image);
  21. ?>