Question: I am new to codeigniter. While submitting the form i am getting 404 error page not found.Actually without entering the username and password it should work the valudations. Here is the code.

> 
> login.php in controller
> 
> 
> 

```
public function verifyuser()
        {

          $this->load->library('form_validation');
          $this->form_validation->set_rules('username','username','required');
          $this->form_validation->set_rules('password','password','required');

          if($this->form_validation->run() == FALSE){
            $this->load->view('login/login');
        }else{
        $this->load->model('login/validate');
        }
        }

```

\****login/login.php*\***

```
<?php echo form_open('verifyuser'); ?>
    <!--  start login-inner -->
    <div id="login-inner">
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <th>Username</th>
            <td><input type="text" name="username"  class="login-inp" /></td>
        </tr>
        <tr>
            <th>Password</th>
            <td><input type="password" name="password" value="************"  onfocus="this.value=''" class="login-inp" /></td>
        </tr>
        <tr>
            <th></th>
            <td valign="top"><input type="checkbox" class="checkbox-size" id="login-check" /><label for="login-check">Remember me</label></td>
        </tr>
        <tr>
            <th></th>
            <td><input type="submit" value="submit" class="submit-login"  /></td>
        </tr>
        </table>
    </div>

```

Answer: 
Default argument values are bound at compile time.

"this" is only defined at run time, so can't be used.

See here for a fuller explanation:
[Must default function parameters be constant in C++?](https://stackoverflow.com/questions/334882/must-default-function-parameters-be-constant-in-c)
Others have already commented on the reason this doesn't work. From one of the comments: 

> 
> "...The expression can combine functions that are visible in the
>  current scope, constant expressions, and global variables. The
>  expression cannot contain local variables or non-static class-member
>  variables..."
> 
> 
> 

You could use `optional` to eliminate the extra function although I'm not sure it's clearer:

`void f( boost::optional<int> i = boost::none ) { if(!i) i = j; ... }`