title: Codeigniter $_SERVER['PHP_SELF'] not working in views
body: <p>I have a dialog form.</p>
  
  <pre><code> &lt;div id="dialog-form" title="Create new Admin"&gt;
  &lt;p class="validateTips"&gt;All form fields are required.&lt;/p&gt;
  
  &lt;form action="&lt;?php $_SERVER['PHP_SELF']; ?&gt;" method="post" enctype="multipart/form-data"&gt;
  &lt;fieldset&gt;
      &lt;label for="name"&gt;Name&lt;/label&gt;
      &lt;input type="text" name="name" id="name" value="" class="text ui-widget-content ui-corner-all" /&gt;
      &lt;label for="role"&gt;Role&lt;/label&gt;
      &lt;select name="user_role" class="select ui-widget-content ui-corner-all" &gt;
      &lt;option value="administrator"&gt;Administrator&lt;/option&gt;
      &lt;option value="visitor"&gt;Visitor&lt;/option&gt;
      &lt;option value="Helper"&gt;Helper&lt;/option&gt;
      &lt;/select&gt;
      &lt;label for="email"&gt;Email&lt;/label&gt;
      &lt;input type="text" name="login_email_admin" id="login_email_admin" value="" class="text ui-widget-content ui-corner-all" /&gt;
      &lt;label for="Passoword"&gt;Password&lt;/label&gt;
      &lt;input type="passowrd" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" /&gt;
      &lt;label for="Passoword"&gt;Re-Enter Password&lt;/label&gt;
      &lt;input type="password" name="password_2" id="password_2" value="" class="text ui-widget-content ui-corner-all" /&gt;
  
      &lt;input style="margin-top:15px;" type="submit" name="add_admin" value="Add New Admin"&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p></p>
  
  <p>i am using following php code in views to take data from this dialog form when it will be submitted..</p>
  
  <pre><code> &lt;?php 
  
      if($_POST['add_admin'])
      {
  
      $this-&gt;user_role=$this-&gt;input-&gt;post('name');
      $this-&gt;user_role=$this-&gt;input-&gt;post('user_role');
      $this-&gt;login_email_admin=$this-&gt;input-&gt;post('login_email_admin');
      $this-&gt;password=$this-&gt;input-&gt;post('password');
  
      $this-&gt;load-&gt;database();
      $this-&gt;db-&gt;insert('admin_user',$this);
      }
  
  ?&gt;
  </code></pre>
  
  <p>But it's not inserting into the db.this problem really stuck me.i am calling page itself when form submit, i dont know what is the reason its not working.
  additionally is there a way that i will get rid of using models, instead i can do all db operations in views?</p>