Posted by Sanders Kaufman on 12/06/06 00:53
Jerry Stuckle wrote:
> Sanders Kaufman wrote:
> It is if you have register_globals on - but that's a very bad thing to
> have - a potential security risk.
Aha! I seem to remember that being part of why I made up my own session
logic. And it begs my next question:
What is the security risk attached to having register_globals turned on?
> $MyVar = isset($_SESSION['MyVar']) ? $_SESSION['MyVar'] : 0;
BONUS! Is that a way of saying "if myvar isn't set, set it to zero"?
I hope so because I've got a bunch of pages with the most convoluted
code just to handle that "unset vs. set to zero" issue.
> If $_SESSION['MyVar'] is set, the value in it will be placed in $MyVar.
> But if $_SESSION['MyVar'] is not set, the code will set $MyVar to 0
> (adjust the default value as you wish - even null is ok).
Cool. Thanks.
You just despaghetti'd a mess o' code.
ps. I tantrumed you as a troll about a month ago when an answer you
gave was a little too *personal*. I'm glad I rebuilt my system and lost
my filter.
[Back to original message]
|