Inconsistent $this->input->post() |
[eluser]sqwk[/eluser]
Code: if($this->input->post('first_name')) { When the first name field has been set (The form has been submitted) but is empty ('') the if statement will not execute. However, when one saves the post value into a variable first, it will. Code: $first_name = $this->input->post('first_name'); Inconsistent?
[eluser]dioramayuanito[/eluser]
Code: <?php "first if" and "second if" run exactly the same. Am i missing somethin?
[eluser]sqwk[/eluser]
You used if($thisis) and not if(isset($thisis))—sorry, apparently posted the wrong example… I get the following: Code: $field = $this->input->post('field')
[eluser]dioramayuanito[/eluser]
Code: // Form has been submitted, but has empty value (Set, but empty) because $this->input->post('field') contains empty string ''. it returns FALSE if you use it inside if-statement. it actually same with $field. All issets return TRUE because you already declare $field before you use isset($field) statement. every variables which already declared Code: $var = ''; |
Welcome Guest, Not a member yet? Register Sign In |