Welcome Guest, Not a member yet? Register   Sign In
Inconsistent $this->input->post()
#1

[eluser]sqwk[/eluser]
Code:
if($this->input->post('first_name')) {
   // Do something
};

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');
if(isset($first_name)) {
   // Do something
};

Inconsistent?


Messages In This Thread
Inconsistent $this->input->post() - by El Forum - 07-10-2011, 07:55 PM
Inconsistent $this->input->post() - by El Forum - 07-10-2011, 09:12 PM
Inconsistent $this->input->post() - by El Forum - 07-10-2011, 09:30 PM
Inconsistent $this->input->post() - by El Forum - 07-10-2011, 09:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB