You are here: Re: -> PHP4 Singleton implementation question <- « PHP Programming Language « IT news, forums, messages
Re: -> PHP4 Singleton implementation question <-

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация