• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
isset: Strange behaviour

Someone knows why this sentence works

if(!isset($hello)) {

and this sentence doesn't work?

if(!isset($this->input->post("Ds_AuthorisationCode"))) {

[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:

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

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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