title: Passing parameters in CodeIgniter
body: <p>I have been banging my head against this problem for about an hour now.  I have looked high and low but nothing is working for me.  This should be simple and I am sure it is.</p>
  
  <p>I am trying to pass some parameters in CodeIgniter to a URL and nothing seems to be working.  Here is my controller:</p>
  
  <pre><code>class Form_controller extends CI_Controller {
      public function change($key = NULL) {
          if (is_null($key)) {
              redirect("reset");
          } else {
              echo "Hello world!";
          }
      }
  }
  </code></pre>
  
  <p>Here is my route:</p>
  
  <pre><code>$route['change/(:any)'] = "form_controller/change/$1";
  </code></pre>
  
  <p>Every time I visit <code>/index.php/change/hello</code> I get the string "Hello world!" but when I visit <code>/index.php/change</code> I got a 404 not found.</p>
  
  <p>What I am trying to do is pass a parameter to my controller for the purposes of checking the DB for a specific key and then acting upon it.  If the key does not exist in the DB then I need to redirect them somewhere else.</p>
  
  <p>Any thoughts on this?</p>