The Securimage library - an open-source free PHP CAPTCHA script |
[eluser]sankai[/eluser]
Hi,guys, The original source from http://www.phpcaptcha.org/ It seems light and simple to use,so I try to fixed it up for CI framework Install: * Download the Securimage Library from http://doublekai.org/files/Securimage_For_CI.zip * Copy file libraries / Securimage.php to application / libraries * Copy file config / Securimage.php to application / config * Copy dir views / fonts to application / views if you want to quickstart test * Copy file controlls / welcome.php to application / controlls * Copy file controlls / image.php to application / controlls * Copy file views / test.html to application / views Example: Controlls - controllers / welcome.php Code: class Welcome extends Controller { Code: class Image extends Controller { Views - views / test.html Code: <?php echo $result?>
[eluser]Shiro[/eluser]
::thumb_up:: Thx for sharing, it really useful! FYI: This Securimage is using Version 1.0.3.1 (Mar 23, 2008)
[eluser]Unknown[/eluser]
I got it working with the exception of the reload link. What is your code for that? Edit: got it working. This is what I sent to my view: $data = array('onclick'=>"document.getElementById('captcha').src = 'captcha/index/' + Math.random(); return false");
[eluser]Unknown[/eluser]
I got it working with the exception of the reload link. What is your code for that? Edit: got it working. This is what I sent to my view:
[eluser]ShoeLace1291[/eluser]
Is there a function that displays only the code? I would like to use this in form validation so there would be a hidden input with the actual text code in it. Then I would use a rule like 'required|matches[actualcode]' for the security text input. Also, mine is only displaying the image, not the character string. Here's my code: Code: function index(){
[eluser]Unknown[/eluser]
This is probably really obvious, but this library requires the html helper to be loaded for the img() function in the view. Also I had issues with it loading a session library when I was autoloading db_session. Commenting out line 476 in the library seemed to do the trick. |
Welcome Guest, Not a member yet? Register Sign In |