Welcome Guest, Not a member yet? Register   Sign In
isset: Strange behaviour
#1

[eluser]libnac[/eluser]
Someone knows why this sentence works

Code:
if(!isset($hello)) {
..
}

and this sentence doesn't work?

Code:
if(!isset($this->input->post("Ds_AuthorisationCode"))) {
..
}
#2

[eluser]Matthew Lanham[/eluser]
Well i dont see any reason why the first one wouldn't work, as long as you have $hello set....on the second one using the codeigniter input class you don't need the isset, as if the POST variable is not set codeigniter would return false so you could try:

Code:
if($this->input->post("Ds_AuthorisationCode") == false){
   //Code here
}
#3

[eluser]webthink[/eluser]
because $this->input->post("Ds_AuthorisationCode") is a function where as $hello is a variable. isset looks in memory for a variable with the name you pass it as opposed to just the value.




Theme © iAndrew 2016 - Forum software by © MyBB