uni Posted January 26, 2005 Report Posted January 26, 2005 Kaa tad lai regjistree globaalos mainiigos?? Kkur bija saciits, ka nedriikst mikseet session_register ar _SESSION, a kam tas peedeejais domaats? Un veel - vai ir iespeejams pieregjistreet sesijas mainiigajos class-i?
Venom Posted January 26, 2005 Report Posted January 26, 2005 miksēt jau var, bet vieglāk register vietā izmantot pa tiešo $_SESSION['index']='value'; saglabāt sessijā klases instanci var, bet pie "ārā ņemšanas", tā tev būs tomēr jāatvasino, kaut vai no stdClass
uni Posted January 26, 2005 Author Report Posted January 26, 2005 A kaa peectam skriptaa nolasa?? $index vai $_SESSION['index']?
uni Posted January 26, 2005 Author Report Posted January 26, 2005 <?php if (! isset($_SESSION['count'])) { $_SESSION['count'] = 1; } else { $_SESSION['count']++; } echo $_SESSION['count']; ?> Shaads te skripts VIENMEER izdod 1.. Un ja vnk $count, ta neko vispaar.. Kaapeec?
рпр Posted January 26, 2005 Report Posted January 26, 2005 saakumaa jau jaapieliek arii session_start()
Venom Posted January 26, 2005 Report Posted January 26, 2005 A kaa peectam skriptaa nolasa?? $index vai $_SESSION['index']? 13120[/snapback] of course $_SESSION['index']; otrais variants iet pie register_globals=on, kas ir evil
uni Posted January 26, 2005 Author Report Posted January 26, 2005 Thanks a million!! Tikai veel par taam class.. Kaa lai uztaisa klasi ar mainiigajiem (tb struktuuru) & ieliek sesijas mainiigajos? Doma taada, ka tas mosh peectam kodaa eertaak rakstiit, nav taads sajukums.. Vai taa var buut? Shaads piegaajiens der: class _user{ public id=""; public nick=""; } if (!isset($_SESSION['user'])) $_SESSION['user'] = new _user; ?
Recommended Posts