Re: session variables

From: Date: Wed, 18 Dec 2002 23:04:54 +0000
Subject: Re: session variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128787@lists.php.net to get a copy of this message
on 19/12/02 2:25 AM, Antti (antti@victoria.fi) wrote: > Neather this seem to work > > $_SESSION['some_variable']=$variable; > > nor this: > > $_SESSION['today']= date('Y-m-d h:m:s'); > > antti What do you mean "don't work"... what are you trying to do? page1.php <? session_start(); $_SESSION['today']= date('Y-m-d h:m:s'); ?> <html> <body> <a href="page.2.php">click to go to page 2</a> </body> </html> page2.php <? session_start(); ?> <html> <body> The value of $_SESSION['today'] is <?=$_SESSION['today']?>. </body> </html> This code assumes you either have trans-sid compiled OR are allowing cookies on your browser AND cookies is a method that PHP sessions use (it is by default) in php.ini. Justin French -------------------- http://Indent.com.au Web Development & Graphic Design --------------------

« previous php.general (#128787) next »