Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuel form with captcha
  • I'm trying use the package Fuel-captcha, but when check is always FALSE...

    My form is:

    [code]
               <div class="control-group">
                    <?php echo Form::label('VALIDA&Ccedil;&Atilde;O', 'captcha', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <?php echo Form::input('captcha', '', array('class' => 'input-small', 'maxlength' => 6)); ?>
                        <span><?php echo Html::img('cert/simplecaptcha/') ?></span>
                    </div>
                    <div class="controls">
                        <span><small>Digite o texto apresentado na figura.</small></span>
                    </div>
                </div>
    [/code]

    My controller has:

    [code]

            public function action_login() {
                ................

                if (Input::method() == 'POST') {
                    
                    $val = Model_Cert::validate_login('login');
       
                    if ($val->run()) {
                        
                        if(! $smpCaptcha->check()) {
                            
                            Session::set_flash('error', e('A VALIDA&Ccedil;&Atilde;O n&atilde;o confere.'));
                            
                        } else {

                        .........

            }

            public function action_simplecaptcha() {
               
                $captcha = Captcha::forge('simplecaptcha');
               
                return $captcha->image();
            }
    [/code]

    my config/simplecaptcha.php has

    [code]

    return array(
      'post_key_name' => 'captcha',
    );

    [/code]

    I'm waiting for any sugestion, I have work hard but I don't found any example of usage of package.
    Thanks


    Medeiros
  • HarroHarro
    Accepted Answer
    I don't know simpleacaptcha, so I can't comment on it.

    But if it's not written for FuelPHP, chances are it will use standard PHP sessions to store the generated captcha. Which is a mechanism you can't use with FuelPHP.
  • I'm use mechanism database, all data in session is work, my project is in production at moment.
    This new functionality is in development. The package is write for FuelPHP...
    This project is in github...


    Medeiros
  • HarroHarro
    Accepted Answer
    Do you have a link to the package?
  • Harro,

    Thanks for your reply, I found a bug in my code. Problem solved..


    Medeiros

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion