Categories > TinyButStrong general >

$_SESSION variable changed if statement

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: handoko
Date: 2010-10-12
Time: 17:21

$_SESSION variable changed if statement

Dear Skrol,

There is a strange behaviour when i use $_SESSION variable in if statement under subtemplate.
for example when i use this code
if ($_SESSION["level"]== "gogo") {
    $q = "select SQL_CALC_FOUND_ROWS a.* from artikel a order by tanggal desc LIMIT $StartIndex,$PageSize ";
} else {
    $q = "select SQL_CALC_FOUND_ROWS a.* from artikel a where publish ='yes' order by tanggal desc LIMIT $StartIndex,$PageSize ";
}

then the value of $_SESSION["level"] will always change into that "gogo" value i/o stay at original value .

Why? how to resolve this problem?

Thanks
By: Skrol29
Date: 2010-10-13
Time: 00:25

Re: $_SESSION variable changed if statement

Hi handoko,

I don't believe this strange behavior can come from TBS.
It rather seems there is a single equal symbol (=) somewhere in your code, something like:
if ($_SESSION["level"]= "gogo")
By: handoko
Date: 2010-10-13
Time: 00:55

Re: $_SESSION variable changed if statement

Hi Skrol,

After trying many times, it doesn't happen anymore....
maybe it come from cookie....

Thanks