CodeIgniter Forums
Captcha in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Captcha in CI (/showthread.php?tid=7151)



Captcha in CI - El Forum - 03-26-2008

[eluser]cinewbie81[/eluser]
I've found this link in order to works on captcha - http://codeigniter.com/wiki/captcha/

The thing is i dont want to modify anything on my db structure ..

then i found this : http://ellislab.com/forums/viewthread/61678/

So i do
Code:
$this->load->helper('captcha');
            
        // create the captcha-config
        $aCaptchaCfg = array(
            //'word'          => 'myrandomword',    //default: random()
            'length'        => 6,                         //default: 5
            'img_path'   => './captcha/',   //no default !
            'img_url'       => site_url().'captcha/',  // no default!
            'font_path'  => './system/fonts/', // default: ./system/fonts/
            'fonts'         => array('texb.ttf'), // default: texb.ttf
            'font_size'     => 25,      // default: 18
            'img_width'  => '180',  // default: 170
            'img_height' => '60',   // default: 60
            'expiration' => 7200 // default: 7200
        );
            
        // get captcha-stuff
        $aCaptcha = create_captcha($aCaptchaCfg);
        print_r($aCaptcha); exit;
When i print_r($aCaptcha) and it return me nothing ... noted that i follow exactly as mentioned in the link


Captcha in CI - El Forum - 03-26-2008

[eluser]cinewbie81[/eluser]
Know where's the problem .. anyway, when i print_r($aCaptcha) now, it return me with the following result :

Code:
Array ( [word] => XJ1VOW [time] => 1206590279.1128 [image] =>

I cant see anything in the image itself except for a white box .. supposefly it should display me some code inside the white box right ? any idea ?


Captcha in CI - El Forum - 03-27-2008

[eluser]louis w[/eluser]
Just to confirm, you have a font file named texb.ttf uploaded to /system/fonts, right?

Or do you have it installed in your CI system folder? If so, shouldn't the font_path be:
Code:
site_url().'system/fonts/'