130 ,'height' => 45 ,'output' => 'png' ,'imageOptions' => [ 'font_size' => 20 ,'font_path' => __DIR__ ,'font_file' => 'IndieFlower.ttf' ,'text_color' => '#559955' ,'lines_color' => '#559955' ,'background_color' => '#DDDDDD' ,'antialias' => true ] ]; $captcha = Text_CAPTCHA::factory ('Image'); $retval = $captcha->init ($options); if (PEAR::isError ($retval)) throw new Exception ('Error initializing CAPTCHA: %s!', $retval->getMessage()); $png = $captcha->getCAPTCHA (); if (PEAR::isError ($png)) throw new Exception ('Error generating CAPTCHA: %s!', $png->getMessage ()); // Get secret passphrase $_SESSION['captcha'] = $captcha->getPhrase (); header ('Content-Type: image/png'); echo $png; } }