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

[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')

// Form has been submitted, but has empty value (Set, but empty)
if ($this->input->post('field')) // FALSE -------------------------- Should be TRUE, or not?
if (isset($field)) // TRUE
if ($field) // FALSE

// Form has been submitted and has a value (Set and not empty)
if ($this->input->post('field')) // TRUE
if (isset($field)) // TRUE
if ($field) // TRUE

// Form has not been submitted (Not set) (No POST data according to profiler)
if ($this->input->post('field'))  // FALSE
if (isset($field)) // TRUE --------------------------- Or rather this should be FALSE?
if ($field) // FALSE


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