Welcome Guest, Not a member yet? Register   Sign In
Captcha : Advanced but simple to use Captcha library (package/spark)
#1

[eluser]c69821bcb[/eluser]
Captcha spark library is based on CodeIgniter's core 'captcha' helper with additional features like:

• Better configuration management.
• Use of Google's simple captcha words database.
• Easy to validate/check captcha.
• Immediate remove validated words to prevent reuse.
• Modified code for cleanup of expired captcha images/records.
• Minimal code for controllers and views (see example).

About

• Author : Azoxy
• Location : http://getsparks.org/packages/Captcha/ve.../HEAD/show
• Code : https://github.com/azoxy/CodeIgniter-Captcha
• Created : 4 September 2011

Requirements

• CodeIgniter 2.0.x

Dependencies

• Libraries = database, session

Installation

1.Install spark by copy files inro sparks directory.
2.Copy your additional font files to 'system/fonts' directory.
3.Make 'images/captcha' directory to store captcha images.
4.Import code from 'sql/captcha.sql' into database.
5.Follow the example code, next.
6.Enjoy.

Example

Controller : Create Captcha Image

Code:
if($this->captcha->create()){
    $data['captcha'] = $this->captcha->html_data;
} else {
    $data['captcha'] = 'Captcha : ' . $this->captcha->debug;
}
$this->load->view('login', $data);

Controller : Check/Validate

Code:
if ($this->captcha->check($this->input->post('captcha'))) {
    $message = "Success";
} else {
    $message = "Failed";
}

View : Output Captcha Image

Code:
<?php echo (!is_array($captcha)) ? $captcha : img($captcha); ?>
#2

[eluser]Keron[/eluser]
Thank you Azoxy for this very useful package. I would like to suggest that you make the debug property public in your captcha class. Thank you again.




Theme © iAndrew 2016 - Forum software by © MyBB