Hello,
I am using PHP 5, Apache on WinXP.
Here is the first php named 1.php
<?php
session_start() ;
$_SESSION[0] = 22 ;
echo $_SESSION[0];
?>
<a href="http://localhost/2.php"> 2php </a>
Here is second php named 2.php
<?php
session_start() ;
if (isset( $_SESSION[0]))
{echo 'set';}
else
{echo 'not set';}
?>
When I ran http://localhost/1.php, there was no problem at all. When I click on the link, 2.php gives 'not set'. Why is the session variable $_SESSION[0] not passed on for 1.php to 2.php? Please help.
I am using PHP 5, Apache on WinXP.
Here is the first php named 1.php
<?php
session_start() ;
$_SESSION[0] = 22 ;
echo $_SESSION[0];
?>
<a href="http://localhost/2.php"> 2php </a>
Here is second php named 2.php
<?php
session_start() ;
if (isset( $_SESSION[0]))
{echo 'set';}
else
{echo 'not set';}
?>
When I ran http://localhost/1.php, there was no problem at all. When I click on the link, 2.php gives 'not set'. Why is the session variable $_SESSION[0] not passed on for 1.php to 2.php? Please help.
Comment