Welcome Guest, Not a member yet? Register   Sign In
Call a plugin in a library..
#1

[eluser]anggie[/eluser]
I am new to CodeIgniter...
I think I can call a plugin within my library. Am I right?
But I don't know why I cannot get a return data from it?
This is my function..
Code:
function setChaptcha()
    {
        $vals = array(
            'img_path'      => './asset/captcha/',
            'img_url'       => base_url().'/asset/captcha/',
            'expiration'    => 3600,// one hour
            'font_path'         => './system/fonts/georgia.ttf',
            'img_width'         => '150',
            'word'            => random_string('numeric', 6),
        );
        $cap = create_captcha($vals);
        $capdb = array(
                'captcha_id'      => '',
                'captcha_time'    => $cap['time'],
                'ip_address'      => $this->SA->input->ip_address(),
                'word'            => $cap['word']
        );
        $query = $this->SA->db->insert_string('captcha', $capdb);
        $this->SA->db->query($query);
        $data['cap'] = $cap;
        return $data;
    }
The error appear like this...
Code:
A Database Error Occurred

Error Number: 1048

Column 'captcha_time' cannot be null

INSERT INTO captcha (captcha_id, captcha_time, ip_address, word) VALUES ('', NULL, '192.168.10.207', NULL)
I did NOT modify the plugin before...
Could you give me some helps?
Thanks...
#2

[eluser]GSV Sleeper Service[/eluser]
silly question, but are you loading the plugin?
also, stick a print_r($cap) after your $cap = create_captcha($vals);
#3

[eluser]anggie[/eluser]
Yes..that is
I am not a high logic programmer.
and I am sure I load the plugin
#4

[eluser]GSV Sleeper Service[/eluser]
try this
Code:
function setChaptcha()
    {
        $vals = array(
            'img_path'      => './asset/captcha/',
            'img_url'       => base_url().'/asset/captcha/',
            'expiration'    => 3600,// one hour
            'font_path'         => './system/fonts/georgia.ttf',
            'img_width'         => '150',
            'word'            => random_string('numeric', 6),
        );
        $cap = create_captcha($vals);
        print_r($cap);
    }
you'll have some debug info on your screen, copy that and paste it back here.
#5

[eluser]anggie[/eluser]
There was nothing...just white screen
#6

[eluser]anggie[/eluser]
Sorry guys...
Silly...yes...silly...
I am just solve my problem...after browse the plugin, i find the clue.
I was wrong in entering the path!
#7

[eluser]anggie[/eluser]
Oh sorry again...
I forget to say Thanks! Especially for GSV Sleeper Service...




Theme © iAndrew 2016 - Forum software by © MyBB