connect()) { exit; } $cd = new clientdata(); $sd = new serverdata(); $db->query('DELETE FROM ' . $db->table['regspam'] . ' WHERE regtime < ' . (time() - 600), __FILE__, __LINE__); $query = $db->query('SELECT regcode FROM ' . $db->table['regspam'] . " WHERE regid='" . $cd->vget('regid', 'string') . "'", __FILE__, __LINE__); if($reg = $db->fetch_assoc($query)) { $width = 30 * strlen($reg['regcode']); if(chkgd2() && function_exists('imagecreatetruecolor')) { $im = imagecreatetruecolor($width + 4, 34); } else { $im = imagecreate($width + 4, 34); } $bg = imagecolorallocate($im, 255, 255, 255); imagefill($im, 0, 0, $bg); for($i = 0; $i < 8; $i++) { $xstart = rand(2, $width / 2); $xend = rand($xstart, $width); $ystart = rand(2, 32); $yend = rand(2, 32); $fg = imagecolorallocate($im, rand(128, 255), rand(128, 255), rand(128, 255)); imagefilledrectangle($im, $xstart, $ystart, $xend, $yend, $fg); } for($i = 0; $i < strlen($reg['regcode']); $i++) { $ch = imagecreatefrompng('images/alpha/' . $reg['regcode'][$i] . '.png'); imagecopy($im, $ch, $i * 30 + 2, 2, 0, 0, 30, 30); } header('Content-type: image/png'); header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1 header('Pragma: no-cache'); // HTTP/1.0 imagepng($im); imagedestroy($im); } $db->close(); ?>