开发者

PHP session problem

Below is my script :

if($redirect==1)
{
?>
    <script>
    setTimeout("gotoLink()",1000);
    function gotoLink()
   {
        location.href='wycomments.php';
  }
    </script>

<?php           
 $_SESSION['BROADCAST_DOWNLOAD']=1; 
}
?>

why i am not getting $_SESSION['开发者_运维问答BROADCAST_DOWNLOAD'] on wycomments.php

any help please.


Without seeing the whole code, it would seem that you are not calling

session_start();

in your php pages so that you can use the $_SESSION object.

See session_start()


Are you sure about these things

  1. Have you started session in wycomments.php
  2. Have you stated session in this code sample file
  3. What is the wrong if I put $_SESSION above the <script> start
 if($redirect==1)
  {
     $_SESSION['BROADCAST_DOWNLOAD']=1; 
      <script>
     setTimeout("gotoLink()",1000);
     function gotoLink()
      {
           location.href='wycomments.php';
      }
     </script>
  }


i think you unset the session so that you are not getting the result... do session_start(); in wycomments.php page

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜