Ich hab jetzt einen captcha code mal gefunden aber wie baue ich den in mein PHP script beziehungsweise in die templates ein.

captcha script
PHP-Code:
<?php
unset($_SESSION['captcha_spam']);

function 
randomString($len)
    {
        function 
make_seed()
        {
            list(
$usec $sec) = explode (' 'microtime());
            return (float) 
$sec + ((float) $usec 100000);
        }
        
        
srand(make_seed()); 
        
//Der String $possible enthält alle Zeichen, die verwendet werden sollen
        
$possible="ABCDEFGHJKLMNPRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789";
        
$str="";
        while(
strlen($str)<$len)
        {
            
$str.=substr($possible,(rand()%(strlen($possible))),1);
        }
        
        return(
$str);
    }

$text randomString(4);  //Die Zahl bestimmt die Anzahl stellen 
$_SESSION['captcha_spam'] = $text;

header('Content-type: image/png');
$img ImageCreateFromPNG('captcha.PNG'); //Backgroundimage
$color ImageColorAllocate($img000); //Farbe 
$ttf $_SERVER['DOCUMENT_ROOT']."/captcha/XFILES.TTF"//Schriftart
$ttfsize 25//Schriftgrösse
$angle rand(0,1);
$t_x rand(1,30);
$t_y 30;

imagettftext($img$ttfsize$angle$t_x$t_y$color$ttf$text);
imagepng($img);

echo 
$text;

?>
templates aufruf
PHP-Code:
$var_eval_index $var_eval_index.templates_file('./templates/gbook.html');
$var_eval_index templates_nigiren($var_eval_index);
eval(
"\$var_eval_index = \"$var_eval_index\";");