title: Codeigniter URI Page redirects
body: <p>I currently have an issue with my URI's </p>
  
  <p>Example I have a function called <code>add</code> - users/add if there is an error with my input form it displays the errors on the users/add page but if all is good it goes back to the users page and shows a success but the uri remains /users/add and I have to re navigate to the users page.</p>
  
  <p><strong>Update:</strong></p>
  
  <p><strong>add:</strong>   </p>
  
  <pre><code> $data['message'] = '&lt;div class="alert alert-success"&gt;&lt;strong&gt;Thank You&lt;/strong&gt; Your User Has Been Added&lt;/div&gt;';
     $this-&gt;session-&gt;set_userdata('message', $data['message']);
     redirect(site_url('dashboard/users'));
  </code></pre>
  
  <p><strong>users:</strong></p>
  
  <pre><code>$message = $this-&gt;session-&gt;userdata('message');
  
          if($message === FALSE)
          {
              $message='';
          }else{
              $this-&gt;session-&gt;unset_userdata('message');
          }
  </code></pre>
  
  <p><strong>Original:</strong></p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public function add()
          {
              $this-&gt;form_validation-&gt;set_rules('userFirstName','First Name', 'required|trim|max_length[99]|xss_clean');
              $this-&gt;form_validation-&gt;set_rules('userLastName','Last Name', 'required|trim|max_length[99]|xss_clean');
      $this-&gt;form_validation-&gt;set_rules('userEmail','E-Mail', 'required|valid_email|trim|max_length[99]|xss_clean|is_unique[users.email]');
              $this-&gt;form_validation-&gt;set_rules('userPassword','Password', 'required|trim|max_length[99]|xss_clean');
  
              if($this-&gt;form_validation-&gt;run() === TRUE)
                  {
                      $userData = array(
                          'fName' =&gt; $this-&gt;input-&gt;post('userFirstName', TRUE),
                          'lName' =&gt; $this-&gt;input-&gt;post('userLastName', TRUE),
                          'email' =&gt; $this-&gt;input-&gt;post('userEmail', TRUE),
                          'password' =&gt; sha1($this-&gt;input-&gt;post('userPassword', TRUE))
                      );  
  
                      $this-&gt;db-&gt;escape($userData);
                      $this-&gt;user_model-&gt;addUser($userData);
  
                      $data['contentMangement'] = $this-&gt;options_model-&gt;systemOptions();
                      $data['pageTitle'] = 'Add User';
                      $data['message'] = '&lt;div class="alert alert-success"&gt;&lt;strong&gt;Thank You&lt;/strong&gt; Your User Has Been Added&lt;/div&gt;';
                      $this-&gt;load-&gt;view('_assets/dashHeader', $data);
                      $this-&gt;load-&gt;view('dashboard/users', $data);
                      $this-&gt;load-&gt;view('_assets/footer');
  
                  }elseif($this-&gt;form_validation-&gt;run() === FALSE)
                  {
                      $data['contentMangement'] = $this-&gt;options_model-&gt;systemOptions();
                      $data['pageTitle'] = 'Add User';
                      $data['message'] = validation_errors('&lt;div class="alert alert-error"&gt;', '&lt;/div&gt;'); 
                      $this-&gt;load-&gt;view('_assets/dashHeader', $data);
                      $this-&gt;load-&gt;view('dashboard/addUser', $data);
                      $this-&gt;load-&gt;view('_assets/footer');
                  }
          }
  </code></pre>