Re: $_SESSION
| From: | Bobo Wieland | Date: | Mon, 13 Jan 2003 14:19:49 +0000 |
| Subject: | Re: $_SESSION | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17821@lists.php.net to get a copy of this message | ||
Oh... I know what was wrong now! After reading some post here I thought that
you initiated a session variable with:
$test = $_SESSION['test'];
and then you could use $test as it is whitout having to write $_SESSION[]
all the time.
But as I see now, I have to make $test a reference to the session variable:
$test = &$_SESSION['test'];
and now everything works... thanks! =)
.bobo :: www.elstudion.com/bobo/
----- Original Message -----
From: "Rich Gray" <rich@f1central.net>
To: "Bobo Wieland" <dev@elstudion.com>
Cc: <php-windows@lists.php.net>
Sent: Monday, January 13, 2003 3:04 PM
Subject: RE: [PHP-WIN] $_SESSION
> well it would seem that you aren't assigning anything to
> $_SESSION['xhtmlStart'] - so does it work if you have this on page one?
>
> <?php
> session_start();
> $_SESSION['xhtmlStart'] = "hello";
> $cellnum = 1;
> define("WHITE", "#ffffff");
> define("LGREY", "#fafafa");
> define("MAXSHOWN", 3);
>
> echo("<a href='svar.php'>test</a>");
> ?>
>
> -----Original Message-----
> From: Bobo Wieland [mailto:dev@elstudion.com]
> Sent: 13 January 2003 13:50
> To: Rich Gray
> Cc: php-windows@lists.php.net
> Subject: Re: [PHP-WIN] $_SESSION
>
>
> okej.. here it comes as short as I could get it... try the 'test' link to
go
> to page2...
>
> page one:
> <?php
> session_start();
> $xhtmlStart = $_SESSION["xhtmlStart"];
> $cellnum = 1;
> define("WHITE", "#ffffff");
> define("LGREY", "#fafafa");
> define("MAXSHOWN", 3);
>
> $xhtmlStart = "hello";
> echo($xhtmlStart);
> echo("<a href='svar.php'>test</a>");
> ?>
>
>
> page 2:
> <?php
> session_start();
> echo($_SESSION["xhtmlStart"]);
> ?>
>
>