title: Codeigniter button redirect
body: <p>I just want to ask because I'm working on Codeigniter and I'm have a button in home page wherein if click, it will page redirect to registration page.</p>
  
  <pre><code>&lt;input type='button' onClick='&lt;?php redirect(base_url() . 'register/index'); ?&gt;' /&gt;
  </code></pre>
  
  <p>I also tried the form helper.</p>
  
  <pre><code>&lt;body&gt;
      &lt;?php
          $data = array('register' =&gt; array('name'    =&gt; 'register',
              'id'        =&gt; 'register',
              'value' =&gt; 'TRUE',
              'type'  =&gt; 'button',
              'content' =&gt; 'Register',
              'onClick'   =&gt; redirect(base_url() . 'register/index')
         );
      ?&gt;
  &lt;table border="1"&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;?php echo form_button(element('register', $data, )); ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The problem is nothing happens when I try to click the button.</p>