Thanks. I'm using PHP-4.3.1.
The problem is not with $_SESSION. I used session_is_registered("sess_var");
to check from the second script and cannot see the variable("sess_var"). Can
anyone tell me why?
page1.php:
<?
session_start();
session_register("sess_var");
$sess_var = "Hello world!";
echo "The content of \$sess_var is $sess_var<br>";
?>
<a href = "page2.php">Next page</a>
page2.php:
<?
session_start();
if (session_is_registered("sess_var")) {
echo "true<br><br>";
}
else
{echo "false<br>";}
echo "sess_var = $_SESSION[sess_var]<br>";
echo "The content of \$sess_var is $sess_var<br>";
// session_unregister("sess_var");
?>
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday 03 June 2003 12:28, Eric D. wrote:
>
> > I have two very simple php scripts and the second srcipt is not seeing
the
> > variables session_registered by the first script.
> > I'm running the latest version of php. And have both "register_globals"
and
> > "track_vars" set to "ON".
>
> It's best to state the specific version of PHP you're using rather than
just
> 'latest' (as it could mean different things to different people at
different
> times).
>
> > Well, the first script prints out the session var fine, but not the
second
> > one. What is wrong? Is there something else I overlooked? Thanks for
your
> > help!
>
> If you're using PHP > 4.1.0 then you ought to be using $_SESSION for all
your
> session needs -- see manual for examples.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> I have a map of the United States. It's actual size. I spent last summer
> folding it. People ask me where I live, and I say, "E6".
> -- Steven Wright
> */
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php