|
Posted by damezumari on 06/13/07 13:09
I have a problem in my application I have not been able to reproduce
completely with a simpler set of files. I know this is a crime, but
here goes:
In a file I have these instructions:
echo 'before: '.$_SESSION['classtitle'].'<br />';
require_once 'test3.php';
echo 'after: '.$_SESSION['classtitle'].'<br />';
echo '<p><a href="test.php">test</a></p>';
They display on the screen:
before: b
test3 before: b
test3 after: a
after: a
So far, so good. But, when I click the link to test.php, this is
displayed:
test: b
I don't understand how $_SESSION['classtitle'] goes back to its old
value.
Here are test3.php and test.php:
test3.php:
<?php
session_start();
echo 'test3 before: '.$_SESSION['classtitle'].'<br />';
$_SESSION['classtitle'] = 'a';
echo 'test3 after: '.$_SESSION['classtitle'].'<br />';
?>
<?php
session_start();
echo 'test: '.$_SESSION['classtitle'].'<br />';
?>
Can anyone point me in the right direction, please?
Regards,
Jan Nordgreen
[Back to original message]
|