Welcome Guest, Not a member yet? Register   Sign In
$this->input->post() data and "undefined index"
#2

[eluser]CroNiX[/eluser]
$this->input->post(var) will return boolean FALSE (currently, but will change to NULL in CI3) if the value doesn't exist, not an empty string which is what you're testing for. Checkboxes that aren't checked don't get sent in the form submission, so they will be FALSE.

Code:
if ( $this->input->post($value) !== FALSE ) //use tripple === operator, you also had an extra )

I'm guessing that the "subject" checkbox wasn't checked, which would cause this error if testing for an empty string, because "subject" doesn't exist in the POST array.


Messages In This Thread
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 08:00 AM
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 09:46 AM
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 10:01 AM
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 10:04 AM
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 10:13 AM
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 10:20 AM
$this->input->post() data and "undefined index" - by El Forum - 06-07-2012, 10:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB