Jump to content

babazumbula

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by babazumbula

  1. OK, Thanks a lot guys ! I'll be employing session var since "static" is not something I completely understand at the moment.
  2. Not sure that I understand completely.
  3. Sorry for delay of crucial information . I prefer not to employ session var,instead I defined static $var_err; but still won't work
  4. The problem must be for reason that at the end of function upload_image() I redirect users to another page and then I call function error() which in that time doesn't hold $this->var_err anymore as true?
  5. Just did it and it echo out: 1 So it works!
  6. Hmm... It would be a help for me if I now this is a correct logic. In essence, should this chunk of code work properly? I mean if this is the correct way to alter $this->var_err then obviously mistake is somewhere else.
  7. I tried this: if(some condition){$this->var_err = true;die();} and it runs expected, If I define $this->var_err = false; then function error()every time returns empty string,however if i define $this->var_err = true; then function error()every time returns 'error'
  8. My fault, function error() does return string, but $this->var_err keeps holding value of 'false'. I'm pretty sure for 'some condition' is true. @ChemicalBliss Tried, no use.
  9. Here's one beginner's question: I have this code class Membership_model extends Model{ var $var_err; function Membership_model(){ parent::Model(); $this->var_err = false; } function upload_image(){ ... if(some condition){$this->var_err = true;} ... } function error(){ if($this->var_err){ $error ='error'; } else{$error = "";} return $error; } } my problem is that function error() always returns false, so line if(some condition){$this->var_err = true;} never gets access to variable $this->var_err = false; I defined in the constructor function. How can I access to this variable and change it from false to true for certain condition?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.