title: Captcha using codeigniter is not working
body: <p>I am trying to implement captcha functionality using codeigniter. But it is not displaying captcha images.</p>
  
  <p>Here is my code :</p>
  
  <p>//Controller file : captcha.php</p>
  
  <pre><code>&lt;?php
  
  class Captcha extends CI_Controller {
      var $controller = "captcha";   
      var $viewContent = array();
  
      public function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;view('header');
      }
  
      /* Function To load captcha view file */
  
      function list_captcha() {
  </code></pre>
  
  <p>// loding captcha helper</p>
  
  <pre><code>        $this-&gt;load-&gt;helper('captcha');
          $data = array(
              'img_path' =&gt; './captcha/',
              'img_url' =&gt; 'localhost/demoProject/application/captcha/',
              'img_width' =&gt; '150',
              'img_height' =&gt; 24,
              'border' =&gt; 0,
              'expiration' =&gt; 7200
          );
          $captchaArr = create_captcha($data);
          $this-&gt;viewContent['captchaArr'] = $captchaArr;
          $this-&gt;viewContent['captchaWord'] = $captchaArr['word'];
          //echo"&lt;pre&gt;"; print_r($captchaArr);exit;
          $this-&gt;viewContent['refreshUrl'] = "localhost/
          demoProject/" . $this-&gt;controller . "/list_" . $this-&gt;controller;
          $this-&gt;load-&gt;view($this-&gt;controller, $this-&gt;viewContent);
          $this-&gt;load-&gt;view('footer');
      }
  
  }
  ?&gt;
  </code></pre>
  
  <p>//view file : captcha.php</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function(){
          $("#captcha").blur(function(){
              if($("#captcha").val()== '&lt;?php echo $captchaWord; ?&gt;'){
                  alert('Captcha match');
              }else{
                  alert('Please enter same word like captcha image.');
              }
          });
      });
  &lt;/script&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;
              Captcha Image
          &lt;/td&gt;
          &lt;td style="text-align: center"&gt;
              &amp;nbsp;&amp;nbsp;&lt;?php echo $captchaArr['image']; ?&gt;&lt;br&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Enter the same code here &lt;/td&gt;
          &lt;td style="text-align: center"&gt;&amp;nbsp;&amp;nbsp;
              &lt;?php
              $data = array('name' =&gt; 'captcha', 'id' =&gt; 'captcha');
              echo form_input($data);
              ?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Can't read the image?&lt;/td&gt;
          &lt;td style="text-align: center"&gt;&amp;nbsp;&amp;nbsp;&lt;a href="&lt;?php echo $refreshUrl; ?&gt;"&gt;Refresh&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I am not getting what is wrong in this code...</p>