Re: session variable in other directories
| From: | billy chan | Date: | Tue, 15 Apr 2003 03:20:10 +0000 |
| Subject: | Re: session variable in other directories | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27086@lists.php.net to get a copy of this message | ||
[13 Apr 2003 16:43:57 -0000] norman@no-gi.de <norman@no-gi.de>
wrote:
> Hello,
>
> i have got a little problem. On my homepage is a login. If the username
> und password is correct i register the $_Session variables
>
> if (mysql_num_rows ($res) > 0)
> {
> $ligne = mysql_fetch_object ($res);
>
> // session_register
> ("x1","x2","x3","x4","x5");
> $_SESSION["x1"] = "true";
> $_SESSION["x2"] = $ligne->name;
> $_SESSION["x3"] = $ligne->mail;
> $_SESSION["x4"] = $ligne->kategorie;
> $_SESSION["x5"] = $ligne->rechte;
>
> In all php files in the same directory i can access this variables, but if
> i am in another directory i does not work. if have already read the
> session_registor is old and should not be used.
>
> I hope some can help me
Place session_start() in the beginning.