L.S.
I am developing a PHP-login script (on Lycos Tripod) that uses Session to
pass on variables. Below is the entire (stripped) structure that I use. It
opens a page where you can Set and Read the session variable BUT ... It
doesn't work!!! It seems that both set- and readlink open their own private
session.
How can I get the read-link to access the proper session variable?
Below is a full testing environment. It uses frames and should work fine ...
but it doesn't. I use this directory-structure:
testindex.php
testmenu.php
testhome.php
login001 [dir]
-----testsetvar.php
-----testreadvar.php
fb001 [dir]
-----testfb.php
-----testframe1.php
-----testframe2.php
The content of the files is:
***************************************
testindex.php
***************************************
<HTML>
<HEAD>
<title>page</title>
</HEAD>
<FRAMESET BORDER="on" cols="200,*">
<FRAME SRC="testmenu.php" NAME=menu>
<FRAME SRC="testhome.php" NAME=main>
</FRAMESET>
</HTML>
***************************************
testmenu.php
***************************************
<HTML>
<HEAD>
<title>Menu</title>
</HEAD>
<BODY>
<A href='login001/testsetvar.php' target='main'>Set</A> the session
variable<BR><BR>
<A href='fb001/testfb.php' target='main'>Read</A> the session variable
</BODY>
</HTML>
***************************************
testhome.php
***************************************
<HTML>
<HEAD>
<title>Home</title>
</HEAD>
<BODY>
This is the Homepage
</BODY>
</HTML>
***************************************
testsetvar.php
***************************************
<?php
session_start();
session_register('testvar');
$testvar="this is the testvariable";
if(session_is_registered('testvar')):
$reg="the testvariable IS registered";
else:
$reg="the testvariable is NOT registered";
endif;
print("var = ".$testvar."<BR>reg = ".$reg."<BR>session ID =
".session_id()."<BR>");
?>
***************************************
testreadvar.php
***************************************
<?
session_start();
if(session_is_registered('testvar')):
$reg="the testvariable IS registered";
else:
$reg="the testvariable is NOT registered";
endif;
print("var = ".$testvar."<BR>reg = ".$reg."<BR>session ID =
".session_id()."<BR>");
?>
***************************************
testfb.php
***************************************
<HTML>
<HEAD>
<title>page</title>
</HEAD>
<FRAMESET BORDER="on" cols="*,150">
<FRAME SRC="testframe1.php" NAME=frame1>
<FRAME SRC="testframe2.php" NAME=frame2>
</FRAMESET>
</HTML>
***************************************
testframe1.php
***************************************
<?
include("../login001/testreadvar.php");
?>
<HTML>
<HEAD>
<title>Home</title>
</HEAD>
<BODY>
<BR>This is frame1<BR>
</BODY>
</HTML>
***************************************
testframe2.php
***************************************
<HTML>
<HEAD>
<title>Home</title>
</HEAD>
<BODY>
<BR>This is frame2
</BODY>
</HTML>
***************************************