Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:13:56+00:00 2026-05-26T19:13:56+00:00

I’m trying to use the recaptcha with CodeIgniter. I followed some online instructions and

  • 0

I’m trying to use the recaptcha with CodeIgniter. I followed some online instructions and finally I have done with only one step, just to pass the recaptcha to the view, but I can’t validate the user input.

Here is my controller:

function download_application()
{
    //load the libraries
    $this->load->library('form_validation');
    $this->load->library('recaptcha');
    $this->lang->load('recaptcha');     
    //common data
    $data['title'] = $_POST['application_name'];
    $data['header'] = $_POST['application_name'];
    $data['sub_header'] = 'تحميل استمارة قبول المشروع';      
    $data['title'] = $_POST['application_name'];
    $data['recaptcha'] = $this->recaptcha->get_html();      
    //form validation
    $this->form_validation->set_error_delimiters('<span class="notification">', '</span>');
    $this->form_validation->set_message('required', 'هذا الحقل مطلوب ولا يمكن تجاهله');
    $this->form_validation->set_rules('name', 'لابد من ادخال اسمك بالكامل', 'required');
    $this->form_validation->set_rules('email', 'لابد من ادخال بريدك الالكترونى', 'required|email');
    $this->form_validation->set_rules('country', 'لابد من ادخال بلدك', 'required');
    $this->form_validation->set_rules('phone', 'لابد من ادخال رقم تليفونك', 'required');

    //form submitted
    if($this->input->post('recaptchasubmit')){
        if($this->form_validation->run() == FALSE) 
        {

            $this->load->view('header', $data);
            $this->load->view('download', $data);
            $this->load->view('footer', $data); 


        }
        else
        {

            $this->load->view('header', $data);
            $this->load->view('download', $data);
            $this->load->view('footer', $data); 

        }
    }       
    else{

            $this->load->view('header', $data);
            $this->load->view('download', $data);
            $this->load->view('footer', $data); 

    }

}

and here is my view

<?php 
    $form_attributes = array(
        'class' => 'form'
    );
    $btn_download = array(
        'type'      => 'image',
        'src'        => base_url().'images/download.gif',
        'name'        => 'recaptchasubmit',
        'width'     => '103',
        'height'    => '33',
        'value'        => 'تحميل'
    );
    $name = array(
        'type' => 'text',
        'name' => 'name',
        'id' => 'name',
        'value' => set_value('title')
    );                      
    $email = array(
        'type' => 'text',
        'name' => 'email',
        'id' => 'email',
        'value' => set_value('email')
    );                               
    $country = array(
        'type' => 'text',
        'name' => 'country',
        'id' => 'country',
        'value' => set_value('country')
    );                                  
    $phone = array(
        'type' => 'text',
        'name' => 'phone',
        'id' => 'phone',
        'value' => set_value('phone')
    );   
?>                      
<?php echo form_open($base_url . 'arabia/download_application', $form_attributes); ?>
<fieldset>
    <div class="input_container">
        <label class="required">الاسم بالكامل</label>
        <div class="input"><?php echo form_input($name); ?></div>
        <?php echo form_error('name'); ?>
    </div>
    <div class="input_container">
        <label class="required">البريد الالكترونى</label>
        <div class="input"><?php echo form_input($email); ?></div>
        <?php echo form_error('email'); ?>
    </div>
    <div class="input_container">
        <label class="required">البلد</label>
        <div class="input"><?php echo form_input($country); ?></div>
        <?php echo form_error('country'); ?>
    </div>
    <div class="input_container">
        <label class="required">التليفون</label>
        <div class="input"><?php echo form_input($phone); ?></div>
        <?php echo form_error('phone'); ?>
    </div>
    <?php echo $recaptcha; ?>
    <?php echo form_error('recaptcha_response_field'); ?>

    <?php echo form_hidden('application_name', $title); ?>
    <?php echo form_hidden('generated_id', $title); ?> 
</fieldset>
<span class="download"><?php echo form_submit($btn_download);?></span>                      
<?php echo form_close();?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:13:57+00:00Added an answer on May 26, 2026 at 7:13 pm

    What do you mean you can’t validate the user input? What is happening when you submit the form? Where are you redirected? What do you see?

    The only thing I can see from your question thus far is that you are passing

    $data['recaptcha'] = $this->recaptcha->get_html();
    

    regardless if validation passes or not – so you’ll see the recaptcha letters/numbers box either way. You need to overwrite that if validation passes to something like:

    $data['recaptcha'] = "validation passed";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to loop through a bunch of documents I have to put
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.