Captcha in CI

#1
[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

#2
[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 ?

#3
[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/'


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.