javascript - Session data could not be read from another window -
this question exact duplicate of:
on test1.php have this:
<?php echo "session variables set."; // set session variables $_session["animal"] = "cat"; echo "session variables set."; echo "favorite animal " . $_session["animal"] . "."; ?> <div ms_positioning="text2d" class="style7"><a href="javascript:winopen();" test2.php="">contact information</a></div> <script> function winopen() { window.open("/test2.php",null,"scrollbars=no,resizable=no,width=600,height=300,top=100,left=100"); } </script>
in test2.php, have this:
<?php // echo session variables set on previous page echo "favorite animal " . $_session["animal"] . "."; ?>
but data not showing on test2.php. did echo on test1.php.
any suggestions?
your test1.php should this:
<?php session_start(); // in case come test1.php echo "session variables set."; // set session variables $_session["animal"] = "cat"; echo "session variables set."; echo "favorite animal " . $_session["animal"] . "."; ?> <div ms_positioning="text2d" class="style7"><a href="javascript:winopen();" test2.php="">contact information</a></div> <script> function winopen() { window.open("/test2.php",null,"scrollbars=no,resizable=no,width=600,height=300,top=100,left=100"); } </script>
and test2.php should this:
<?php session_start(); // echo session variables set on previous page echo "favorite animal " . $_session["animal"] . "."; ?>
Comments
Post a Comment