Hi, i'm trying to generate a Captcha image but it is not showing.
The following is my function -it is just a copy and edit of CI's documentation:
I am on a local server and have the GD library installed -- am using XAMMP.
What could I have missed?
The following is my function -it is just a copy and edit of CI's documentation:
PHP Code:
public function captcha_create()
{
$this->load->helper('captcha');
$vals = array(
'img_path' => FCPATH.'captcha/',
'img_url' => base_url('captcha/'),
'img_width' => '150',
'img_height' => 30,
'expiration' => 1800,
'word_length' => 8,
'font_size' => 16,
'img_id' => 'Imageid',
'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
// White background and border, black text and red grid
'colors' => array(
'background' => array(255, 255, 255),
'border' => array(255, 255, 255),
'text' => array(160, 28, 55),
'grid' => array(28, 160, 133)
)
);
$cap = create_captcha($vals);
echo $cap['image'];
}
What could I have missed?