• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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