Welcome Guest, Not a member yet? Register   Sign In
Captcha image not showing?
#11

[eluser]PAstorKill[/eluser]
The code of captcha_lib:



<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Captcha_lib
{
public function captcha_actions()

{
$CI = & get_instance();

$CI->load->plugin('captcha_pi');

$CI->load->helper('string');
$rnd_str = random_string('numeric',5);

$ses_data= array();
$ses_data['rnd_captcha'] = $rnd_str;
$CI->session->set_userdata($ses_data);


$settings = array ('word' => $rnd_str,
'img_path' => './img/captcha/',
'img_url' => base_url().'/img/captcha',
'font_path' => './system/fonts/LucidaBrightDemiBold.ttf',
'img_width' => 120,
'img_height' => 30,
'expiration' => 10);

$captcha = create_captcha($settings);


$imgcode = $captcha['image'];
return $imgcode;
}

}



?>


Why browser says that - Call to undefined method CI_Loader::plugin() ??????????
#12

[eluser]Bigil Michael[/eluser]
use this code

$this->load->plugin('captcha');

then putting captcah_pi.php inside system / plugins folder
#13

[eluser]Unknown[/eluser]
[quote author="John V4lkyr" date="1295866285"]

sorry my english is not good,

i have the same problem like this too,
then i found the problem is on my .htaccess file so i just edit the file and add the folder name to
the .htaccess file like this :

from :
RewriteCond $1 !^(index\.php|asset|inc|images|robots\.txt)
to :
RewriteCond $1 !^(index\.php|asset|captcha|inc|images|robots\.txt)

note that i just add the folder named 'captcha' to the string above

may it helpfull...[/quote]

Thanks a lot for your advice. It helped me!




Theme © iAndrew 2016 - Forum software by © MyBB