title: Passing parameters through URL in CodeIgniter
body: <p>I'm having a problem regarding passing parameter from url. The function I use sometimes give the correct result and sometimes not.</p>
  
  <p>here is my controller functions:</p>
  
  <pre><code>    public function link_gen(){
      $text = "i have lost my password please help me";
  
      $encrypted_text = $this-&gt;encrypt-&gt;encode($text);
      $encrypted_url = urlencode($encrypted_text);
      echo $encrypted_url. br();
  
      echo br(). $this-&gt;retrive(urldecode($encrypted_url));
  
      echo anchor('encryption/ret_back?username='.$encrypted_url, 'click me');
  </code></pre>
  
  <p>//      echo anchor('encryption/ret_back/'.$encrypted_url, 'click me');
      }</p>
  
  <pre><code>public function ret_back(){
  </code></pre>
  
  <p>//      echo br(). $this->retrive(urldecode($str));</p>
  
  <pre><code>            $user = $this-&gt;input-&gt;get('username');
      echo br(). $this-&gt;retrive(urldecode($user));
  
      echo $user. br();
      echo "hellooooo". br();
  }
  </code></pre>
  
  <p>For the sake of testing I'm encrypting a text then encode it in URL using <code>urlencode()</code>, then I pass this string to another function using URL, and then decode in the string in URL using <code>urldecode()</code> and then decode the text. But when I run this, sometimes the decoded text appears and sometimes it does not.</p>
  
  <p>Can anybody tell me the reason and solution for this?</p>
  
  <p>I want to use this in a 'forgot password' module.</p>