0

I am confused with the PHP session variables, i am trying since long and trying to change and modify the session variable, but no result. It will be really a great help if you could shed some light and rectify my problem

  1. I have a page (say page1.php) and from this page, i am sending data to page2.php to process some ajax queries and whatever PHP variable is generating, i am storing that variable in session variable as $_SESSION['myvar'] = $a; , (where 'a' is having some String value ) and i am echo this value at this page and is getting printed correctly.

  2. Again, when after executing the above code, the execution counter comes back to Page1.php and here i am trying to get PHP variable stored in Page2.php as <?php echo $_SESSION['myvar']; ?>

But here i am not getting the result? why ??

I have used session_start(); as the first command on each page (Page1.php and Page2.php). Can you please help me ?? Thanks in advance

Amul Bhatia
  • 154
  • 1
  • 11

0 Answers0