Re: very dumb question, need help
| From: | Hardy Merrill | Date: | Mon, 02 Apr 2001 13:30:39 +0000 |
| Subject: | Re: very dumb question, need help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46613@lists.php.net to get a copy of this message | ||
At the top of every script that will register or use session
variables, I do "session_register" - something like this:
script_1.php
------------
<?php
session_start();
session_register("test");
$test = "myname";
?>
script_2.php
------------
<?php
session_start();
echo "Value of \$test = $test"; // value should be "myname"
?>
HTH.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
Jacky [jacky@activelifestyle.com] wrote:
> Hi all
> I have been to look at manual about session, in php4, still not quite get it.
> Basically if I have sniplet below in one page, how do I assign value into that session and how
do I call it up in next page? I sthe way I assign value into session correct? ( I think it did not,
because it did not work, but still need to show what I did, so help can get to the right point
easier).
> Note: that I simply hardcode value into session just to see if it will like it.
> *************************
> <?php
> session_register("test");
> $test = "myname";
> ?>
> *********************
> Jack
> jacky@activelifestyle.com
> "There is nothing more rewarding than reaching the goal you set for yourself"