Jump to content
php.lv forumi

_SESSION


uni

Recommended Posts

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?

Link to comment
Share on other sites

<?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?

Link to comment
Share on other sites

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;

 

?

Link to comment
Share on other sites

×
×
  • Create New...