How to integrate securimage captcha to codeigniter

Heres how:
1.) Download the open source securimage library from:

2.) Copy the library in your codeigniter's application/library folder.

3.) Create a function in your codeigniter's controller's class (example index)

function securimage() {
$img = new Securimage();
$img->show(); // alternate use: $img->show('/path/to/background.jpg');

4.) In the view where you will place the captcha, insert this line:

<img src="<?=site_url('index/securimage')?>" alt='captcha' />

site_url() - gives the base url with index.php in the end
index - controller
securimage - is the function
How to integrate securimage captcha to codeigniter How to integrate securimage captcha to codeigniter Reviewed by czetsuya on Thursday, August 20, 2009 Rating: 5


Remo Harsono said...

on my system, I have to copy the font file to the CI folder

Anonymous said...

Aproximately this will work to create a captcha, but how do you check if the user inserted the right captcha code?

You must start a session and then check if automatically checks if the session variable is the same with the created one. But.. CI runs different sessions than the one in php which are used by secuimage...

Nabin Khatri said...

Is there any way to use the audio of securimage in codeigniter? It would be helpful if anyone could help me?

Powered by Blogger.