View file captcha.php

File size: 688B
<?php
include "header/config.inc.php";
include "header/function.inc.php";
include "header/connect.inc.php";
include "header/click-club.class.php";

@mysql_query("DELETE FROM `".prefix."captcha` WHERE (`ip`='".ip."' && `ua`='".short_agent."') OR `ts`<".(time()-captchado));
$c = $click_club->captcha_text(lenght_code);
$result=@mysql_query("INSERT into `".prefix."captcha`(`ip`,`ua`,`ts`,`code`)values('".ip."','".short_agent."','".time()."','".$c."')");
If (!$result) exit(2);

$image=imageCreateFromPng("captcha.png");
$colour=imageColorAllocate($image,0,0,0);
imageTTFText($image,20,0,2,25,$colour,getcwd()."/click-club.ttf",$c);
header("Content-type: image/png");
imagepng($image);
?>