Welcome Guest, Not a member yet? Register   Sign In
[Need Help] Captcha image doesnt work
#1

[eluser]daynie[/eluser]
I have a register model on my 1st site but every new user try to submit for the captcha image, it always failed with the notice "security code doesnt match". I'm still newbie in php understanding.
Pls help me for solving it. Thanks all
#2

[eluser]TheFuzzy0ne[/eluser]
It would really help if we could see the code you're using. An example of your controller and view would be great.
#3

[eluser]daynie[/eluser]
this the captcha code locate in my controller folder

====================================================
<?php

class Captcha extends Controller
{
//Constructor
function Captcha()
{
parent::Controller();
}
function index()
{
//Load the captcha plugin
$this->load->plugin('captcha');
//Create the captcha image
$randKey = rand();
$vals = array('word' => $this->_randomPassword(5, $randKey), 'img_path' => BASEPATH . '../application/images/captcha/', 'img_url' => base_url() . 'application/images/captcha/', 'font_path' => BASEPATH . '../application/fonts/verdana.ttf', 'font_size' => 25, 'img_width' => 150, 'img_height' => 30, 'expiration' => 7200);
$cap = create_captcha($vals);
echo $cap['word'] . '|' . $cap['time'] . '|' . $randKey;
}
function _randomPassword($length = 8, $seed = '')
{
$password = "";
$possible = "0123456789";
$i = 0;
mt_srand(($seed == '') ? rand() : $seed);
while ($i < $length)
{
$char = substr($possible, mt_rand(0, strlen($possible) - 1), 1);
if (!strstr($password, $char))
{
$password .= $char;
$i++;
}
}
return $password;
}
}
?&gt;
=============================================================================================================

and there are many file with .tpl extention in the view folder, i dont know which one suppose to b show
#4

[eluser]TheFuzzy0ne[/eluser]
What am I missing here? I don't see where any view is loaded, and I don't see any validation or code to handle the form submission.
#5

[eluser]daynie[/eluser]
yea thats what i mean, i'm still newbie in this part .. hehehehehe. Would you like to tell me how? thx
#6

[eluser]TheFuzzy0ne[/eluser]
I wrote an abstraction layer yesterday for Securimage, which allows fully customizable captchas, with audio support. I think that the working example in there might help you get started. http://ellislab.com/forums/viewthread/105788/
#7

[eluser]daynie[/eluser]
thanks fuz, i'll try
#8

[eluser]daynie[/eluser]
i dont know how to make the configuration on ur code. I hav try to upload and make test but nothing happen
#9

[eluser]TheFuzzy0ne[/eluser]
The readme.txt file should explain everything. You should upload the captcha.php controller first, then go to http://yoursite.tld/captcha/compatibility_test.

That will tell you if it will work on your server or not. There is also a working example.

The configuration is done via ./system/application/config/securimage.php
#10

[eluser]daynie[/eluser]
u r gud .. hehe i thought its a virus when comes with big smile on compability test. Now would you tell how to integrate ur code into registration model and submitting for validation? thanks ..




Theme © iAndrew 2016 - Forum software by © MyBB