|
Posted by flintridgeparkenfarker vonkerschnauzerheiden on 06/14/05 06:09
On local PC, WinXP, Apache 2, PHP 5, globals off, I'm simply trying to pass
1 value to get sessions working.
On the first page (end of HTML) I do show a value in $_SESSION['item'] right
after setting it:
FIRST PAGE:
<a href=secondpage.php>link</a>
</body>
</html>
<?
if (session_start()) {
echo "session started...";
$_SESSION['item']="necklace";
if (isset($_SESSION['item']))
echo "session item is SESSION = " . $_SESSION['item'];
else
echo "session item is not set";
}
else {
echo "no session started";
}
?>
------------------------------------------------------------------
BUT SHOW NO VALUE ON THE SECOND PAGE:
<?
if (session_start())
echo "session has begun...";
else
echo "no session.";
echo "<BR>";
echo "<BR>";
echo "going to end " . session_name() . " session; but first... <BR>";
if (isset($_SESSION['item']))
echo "Session[item] = " . $_SESSION['item'];
else
echo "session item is not set";
?>
------------------------------------------------------------
The output of the second page is:
"session has begun...
going to end PHPSESSID session; but first...
session item is not set
--------------------------------------------------------
Within the "session.save_path" are the files created by these statements and
the value "necklace" but I'm just not able to extract that value on any
other pages. I've tried placing the second page in a subdirectory per an
earlier post, no good. It seems like it's a configuration issue, but I'm
unable to find anything that relates.
I'd wager it's something simple, but it's been a couple weeks and I can't
find it yet. Any help would definitely be appreciated.
Thanks all.
--
joe
/*------- A new survey of online daters found that
47% of people believe that their online date will
go well... the other 53% are still missing. -------*/
[Back to original message]
|