Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/sys_antibot.txt
<?php
/*
OpenDataBag - Data Web Interface
Copyright (C) 2004 Nawara

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

$letter1='BCFHKMNPRSTZ';
$letter2='aeiuy';
$letter3='bcdfkmnprstwz';
$letter4='aeiuy';
$letter5='cdfhjkmnprstw';

$letter1=$letter1[rand(0,strlen($letter1)-1)];
$letter2=$letter2[rand(0,strlen($letter2)-1)];
$letter3=$letter3[rand(0,strlen($letter3)-1)];
$letter4=$letter4[rand(0,strlen($letter4)-1)];
$letter5=$letter5[rand(0,strlen($letter5)-1)];

$string = strtolower($letter1.$letter2.$letter3.$letter4.$letter5);

$im = @imagecreate(80, 30)
   or die("Cannot Initialize new GD image stream");

$white = imagecolorallocate($im, 255, 255, 255);
$gray = imagecolorallocate($im, 150, 150, 150);
$black = imagecolorallocate($im, 100, 100, 100);

imagettftext($im, 20, 0, 0, 23, $black, cfg_data_path.'/script/fonts/ariendezze.ttf', $string);
//imagettftext($im, 20, 0, 0, 30, $black, cfg_images_path.'/script/fonts/boredsb.ttf', $string);

addpath(cfg_sso_path.'/temp/antibot');
$fp=fopen(cfg_sso_path.'/temp/antibot/'.$sid,'w');
fwrite($fp,$string);
fclose($fp);

header("Content-type: image/jpeg");

imagejpeg($im);
imagedestroy($im);

exit;
?>
Return current item: OpenBizMap