• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inconsistent $this->input->post()

#4
[eluser]dioramayuanito[/eluser]
Code:
// Form has been submitted, but has empty value (Set, but empty)
if ($this->input->post('field')) // FALSE -------------------------- Should be TRUE, or not?

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 = '';

// This will evaluate to TRUE so the text will be printed.
if (isset($var)) {
    echo "This var is set so I will print.";
}
from isset example at http://php.net/manual/en/function.isset.php


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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.