session_register working but $_session isn't
Posted: Fri Sep 26, 2003 5:59 am
Using PHP version 4.1.2
Running test.php & test2.php gives the following output.
Current page: A = Page A
Current page: Z =
Why isn't the $_session['current_page_z'] = "Page Z"; working?
I've checked all the documentation...
<?php
// test.php
session_start();
$current_page_a = "Page A";
session_register ("current_page_a");
$_session['current_page_z'] = "Page Z";
$_sid_value = "?" . SID;
?>
<A HREF="test2.php?<?php echo strip_tags (SID)?>">Click here</A>
============================================
<?php
// test2.php
session_start();
print("Current page: A = " . $current_page_a . "<br>");
print("Current page: Z = " . $_SESSION['current_page_b'] . "<br>");
?>
============================================
Running test.php & test2.php gives the following output.
Current page: A = Page A
Current page: Z =
Why isn't the $_session['current_page_z'] = "Page Z"; working?
I've checked all the documentation...
<?php
// test.php
session_start();
$current_page_a = "Page A";
session_register ("current_page_a");
$_session['current_page_z'] = "Page Z";
$_sid_value = "?" . SID;
?>
<A HREF="test2.php?<?php echo strip_tags (SID)?>">Click here</A>
============================================
<?php
// test2.php
session_start();
print("Current page: A = " . $current_page_a . "<br>");
print("Current page: Z = " . $_SESSION['current_page_b'] . "<br>");
?>
============================================