Welcome Guest, Not a member yet? Register   Sign In
Better than if(count($_POST) > 0)
#17

[eluser]Matalina[/eluser]
[quote author="johnpeace" date="1330708813"][quote author="veledrom" date="1330708084"]
This way doesn't work.
Code:
if(! $this->input->post('submit_name')) {
// do something
}
[/quote]

This does though:
Code:
if($this->input->post('submit_button') != 'Login') {
// do something
}
[/quote]

I do it all the time The above quoted code is wrong tho there is no !
Code:
if($this->input->post('submit_name')) {
// do something
}

if $this->input->post('submit_name') has something in it it will return TRUE because it's not empty if('hi') is always true.


Messages In This Thread
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 04:13 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 04:45 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 05:13 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 05:19 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 05:42 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 05:52 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 07:34 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 07:37 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 07:41 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 08:45 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 09:22 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 09:58 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 10:08 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 10:20 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 10:49 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 10:53 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 11:54 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 11:59 AM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 12:07 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 12:22 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 12:54 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 01:47 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 02:20 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 02:23 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 02:34 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 02:46 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 03:05 PM
Better than if(count($_POST) > 0) - by El Forum - 03-02-2012, 09:39 PM
Better than if(count($_POST) > 0) - by El Forum - 03-03-2012, 09:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB